Make WordPress Core

Changeset 41149


Ignore:
Timestamp:
07/25/2017 04:12:29 PM (8 years ago)
Author:
afercia
Message:

Widgets: make the Recent Posts widget output '(no title)' for posts without a title.

Since WordPress 2.3, the Recent Posts widget used to output the post ID for posts
with an empty title. Using '(no title)' seems a best option and is consistent with
what's already used in other similar cases.

Props antonrinas, Ankit K Gupta.
Fixes #35709.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-recent-posts.php

    r40806 r41149  
    8383        <?php while ( $r->have_posts() ) : $r->the_post(); ?>
    8484            <li>
    85                 <a href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : the_ID(); ?></a>
     85                <a href="<?php the_permalink(); ?>"><?php get_the_title() ? the_title() : _e( '(no title)' ); ?></a>
    8686            <?php if ( $show_date ) : ?>
    8787                <span class="post-date"><?php echo get_the_date(); ?></span>
Note: See TracChangeset for help on using the changeset viewer.