From 9c9aa55274062c430bea50773e8993865c52d874 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 2 Mar 2014 22:33:25 +0000 Subject: [PATCH] Display empty-titled pages properly in Walker_PageDropdown, like we do in Walker_Page. fixes #27218. git-svn-id: https://develop.svn.wordpress.org/trunk@27360 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-template.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index 94b01eb484..1a7fc1bb1b 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -1147,7 +1147,13 @@ class Walker_PageDropdown extends Walker { if ( $page->ID == $args['selected'] ) $output .= ' selected="selected"'; $output .= '>'; - $title = apply_filters( 'list_pages', $page->post_title, $page ); + + $title = $page->post_title; + if ( '' === $title ) { + $title = sprintf( __( '#%d (no title)' ), $page->ID ); + } + + $title = apply_filters( 'list_pages', $title, $page ); $output .= $pad . esc_html( $title ); $output .= "\n"; }