Show a label for the "Home" page nav menu item checkbox. props SergeyBiryukov. props ericlewis for the initial patch. fixes #25410.
git-svn-id: https://develop.svn.wordpress.org/trunk@25741 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
56bef8b6a6
commit
99df61b666
@ -299,16 +299,21 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
|
|||||||
$output .= $indent . '<li>';
|
$output .= $indent . '<li>';
|
||||||
$output .= '<label class="menu-item-title">';
|
$output .= '<label class="menu-item-title">';
|
||||||
$output .= '<input type="checkbox" class="menu-item-checkbox';
|
$output .= '<input type="checkbox" class="menu-item-checkbox';
|
||||||
if ( property_exists( $item, 'front_or_home' ) && $item->front_or_home ) {
|
|
||||||
$title = sprintf( _x( 'Home: %s', 'nav menu front page title' ), get_the_title( $item->ID ) );
|
if ( ! empty( $item->front_or_home ) )
|
||||||
$output .= ' add-to-top';
|
$output .= ' add-to-top';
|
||||||
} elseif ( property_exists( $item, 'label' ) ) {
|
|
||||||
$title = $item->label;
|
|
||||||
}
|
|
||||||
$output .= '" name="menu-item[' . $possible_object_id . '][menu-item-object-id]" value="'. esc_attr( $item->object_id ) .'" /> ';
|
$output .= '" name="menu-item[' . $possible_object_id . '][menu-item-object-id]" value="'. esc_attr( $item->object_id ) .'" /> ';
|
||||||
if ( isset( $item->post_type ) )
|
|
||||||
$output .= empty( $item->label ) ? esc_html( get_the_title( $item->ID ) ) : esc_html( $item->label );
|
if ( ! empty( $item->label ) ) {
|
||||||
else
|
$title = $item->label;
|
||||||
|
} elseif ( isset( $item->post_type ) ) {
|
||||||
|
//duplicate_hook
|
||||||
|
$title = apply_filters( 'the_title', $item->post_title, $item->ID );
|
||||||
|
if ( ! empty( $item->front_or_home ) && _x( 'Home', 'nav menu home label' ) !== $title )
|
||||||
|
$title = sprintf( _x( 'Home: %s', 'nav menu front page title' ), $title );
|
||||||
|
}
|
||||||
|
|
||||||
$output .= isset( $title ) ? esc_html( $title ) : esc_html( $item->title );
|
$output .= isset( $title ) ? esc_html( $title ) : esc_html( $item->title );
|
||||||
$output .= '</label>';
|
$output .= '</label>';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user