WordPress.org

Make WordPress Core

Changeset 45727


Ignore:
Timestamp:
08/03/2019 12:18:50 PM (2 years ago)
Author:
afercia
Message:

Menus: Fix the Custom Links text fallback.

When adding a Custom Link and leaving the "Link Text" field empty, WordPress used to set a default fallback text: "Menu Item".

The changes in [36379] broke this behavior making the fallback text: (Pending), with a leading space.

Pending major refactoring of the Menus page (which is going to use a block-based user interface) this change just restores the original behavior by adding the fallback text to the related AJAX response.

Props christophherr, Fencer04, thakkarhardik, backermann1978, audrasjb.
Fixes #38415.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r45723 r45727  
    14311431        if ( ! empty( $menu_obj->ID ) ) {
    14321432            $menu_obj        = wp_setup_nav_menu_item( $menu_obj );
     1433            $menu_obj->title = empty( $menu_obj->title ) ? __( 'Menu Item' ) : $menu_obj->title;
    14331434            $menu_obj->label = $menu_obj->title; // don't show "(pending)" in ajax-added items
    14341435            $menu_items[]    = $menu_obj;
Note: See TracChangeset for help on using the changeset viewer.