Nav Menus: Apply the `the_title` filter on original post titles in `wp_setup_nav_menu_item()`.

The filter is already used in `Walker_Nav_Menu_Checklist` and `Walker_Nav_Menu_Edit`. This ensures that titles are consistent across the admin and front end.

Fixes #35317.
Built from https://develop.svn.wordpress.org/trunk@36174


git-svn-id: http://core.svn.wordpress.org/trunk@36141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-01-05 16:27:26 +00:00
parent e51c790844
commit 0b6c5744dc
2 changed files with 3 additions and 2 deletions

View File

@ -739,7 +739,8 @@ function wp_setup_nav_menu_item( $menu_item ) {
$menu_item->url = get_permalink( $menu_item->object_id ); $menu_item->url = get_permalink( $menu_item->object_id );
$original_object = get_post( $menu_item->object_id ); $original_object = get_post( $menu_item->object_id );
$original_title = $original_object->post_title; /** This filter is documented in wp-includes/post-template.php */
$original_title = apply_filters( 'the_title', $original_object->post_title, $original_object->ID );
if ( '' === $original_title ) { if ( '' === $original_title ) {
/* translators: %d: ID of a post */ /* translators: %d: ID of a post */

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.5-alpha-36173'; $wp_version = '4.5-alpha-36174';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.