WordPress.org

Make WordPress Core

Changeset 45828


Ignore:
Timestamp:
08/19/2019 03:55:47 AM (4 weeks ago)
Author:
SergeyBiryukov
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.
Merges [45727] to the 5.2 branch.
Fixes #38415.

Location:
branches/5.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.2

  • branches/5.2/src/wp-admin/includes/ajax-actions.php

    r45508 r45828  
    14241424        if ( ! empty( $menu_obj->ID ) ) {
    14251425            $menu_obj        = wp_setup_nav_menu_item( $menu_obj );
     1426            $menu_obj->title = empty( $menu_obj->title ) ? __( 'Menu Item' ) : $menu_obj->title;
    14261427            $menu_obj->label = $menu_obj->title; // don't show "(pending)" in ajax-added items
    14271428            $menu_items[]    = $menu_obj;
Note: See TracChangeset for help on using the changeset viewer.