From 8fa00f68e707611d69daf12975b2d7aedecb9b4f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 2 Mar 2014 22:34:13 +0000 Subject: [PATCH] Display empty-titled pages properly in Walker_PageDropdown, like we do in Walker_Page. fixes #27218. Built from https://develop.svn.wordpress.org/trunk@27360 git-svn-id: http://core.svn.wordpress.org/trunk@27210 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-template.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 94b01eb484..1a7fc1bb1b 100644 --- a/wp-includes/post-template.php +++ b/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"; }