Make WordPress Core

Ticket #32710: 32710.3.diff

File 32710.3.diff, 1.4 KB (added by kirasong, 9 years ago)

Refresh and combine of both previous patches.

  • src/wp-admin/js/customize-nav-menus.js

    diff --git a/src/wp-admin/js/customize-nav-menus.js b/src/wp-admin/js/customize-nav-menus.js
    index 58c27a8..bf73baa 100644
    a b  
    261261                        self.currentRequest.fail(function( data ) {
    262262                                // data.message may be undefined, for example when typing slow and the request is aborted.
    263263                                if ( data.message ) {
    264                                         $content.empty().append( $( '<p class="nothing-found"></p>' ).text( data.message ) );
     264                                        $content.empty().append( $( '<div class="nothing-found"></p>' ).html( data.message ) );
    265265                                        wp.a11y.speak( data.message );
    266266                                }
    267267                                self.pages.search = -1;
  • src/wp-includes/class-wp-customize-nav-menus.php

    diff --git a/src/wp-includes/class-wp-customize-nav-menus.php b/src/wp-includes/class-wp-customize-nav-menus.php
    index 502ad2b..2629504 100644
    a b final class WP_Customize_Nav_Menus { 
    205205                $items = $this->search_available_items_query( array( 'pagenum' => $p, 's' => $s ) );
    206206
    207207                if ( empty( $items ) ) {
    208                         wp_send_json_error( array( 'message' => __( 'No menu items found.' ) ) );
     208                        wp_send_json_error( array( 'message' => '<p>' . __( 'No results found.' ) . '</p><p>' . __( 'You must publish content before you can add it as a menu item or you can add external links using the Links section below.' ) . '</p>' ) );
    209209                } else {
    210210                        wp_send_json_success( array( 'items' => $items ) );
    211211                }