WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/25/2019 09:51:00 PM (8 weeks ago)
Author:
whyisjake
Message:

Menus: Duplicate Page Entry in View All Pages when generating a Menu

Simplifies the interface in menu creation.

Fixes [37782]
Props garrett-eclipse, mdgl, birgire, xkon, audrasjb, pento, girlieworks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-walker-nav-menu-checklist.php

    r45932 r46309  
    9595            /** This filter is documented in wp-includes/post-template.php */
    9696            $title = apply_filters( 'the_title', $item->post_title, $item->ID );
    97             if ( ! empty( $item->front_or_home ) && _x( 'Home', 'nav menu home label' ) !== $title ) {
    98                 /* translators: %s: Front page title. */
    99                 $title = sprintf( _x( 'Home: %s', 'nav menu front page title' ), $title );
    100             }
    10197        }
    10298
    10399        $output .= isset( $title ) ? esc_html( $title ) : esc_html( $item->title );
     100
     101        if ( empty( $item->label ) && isset( $item->post_type ) && 'page' === $item->post_type ) {
     102            // Append post states.
     103            $output .= _post_states( $item, false );
     104        }
     105
    104106        $output .= '</label>';
    105107
Note: See TracChangeset for help on using the changeset viewer.