Make WordPress Core

Ticket #44104: 44104.2.diff

File 44104.2.diff, 1.3 KB (added by dlh, 6 years ago)
  • src/wp-includes/class-wp-customize-nav-menus.php

    diff --git src/wp-includes/class-wp-customize-nav-menus.php src/wp-includes/class-wp-customize-nav-menus.php
    index 1a55fa6ce2..d2a346d5b0 100644
    final class WP_Customize_Nav_Menus { 
    324324
    325325                // Prepend list of posts with nav_menus_created_posts search results on first page.
    326326                $nav_menus_created_posts_setting = $this->manager->get_setting( 'nav_menus_created_posts' );
    327                 if ( 1 === $args['pagenum'] && $nav_menus_created_posts_setting && count( $nav_menus_created_posts_setting ) > 0 ) {
     327                if ( 1 === $args['pagenum'] && $nav_menus_created_posts_setting && count( $nav_menus_created_posts_setting->value() ) > 0 ) {
    328328                        $stub_post_query = new WP_Query(
    329329                                array_merge(
    330330                                        $query,
  • tests/phpunit/tests/customize/nav-menus.php

    diff --git tests/phpunit/tests/customize/nav-menus.php tests/phpunit/tests/customize/nav-menus.php
    index e37b94b09f..a5ebfc92f7 100644
    class Test_WP_Customize_Nav_Menus extends WP_UnitTestCase { 
    297297         */
    298298        function test_search_available_items_query() {
    299299                $menus = new WP_Customize_Nav_Menus( $this->wp_customize );
     300                do_action( 'customize_register', $this->wp_customize );
    300301
    301302                // Create posts.
    302303                $post_ids   = array();