WordPress.org

Make WordPress Core

Changeset 43481


Ignore:
Timestamp:
07/17/2018 02:39:59 PM (3 years ago)
Author:
azaozz
Message:

Customize: Do not attempt to count uncountable value.

Props dlh.
Merges [43480] to the 4.9 branch.
Fixes #44104.

Location:
branches/4.9
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/class-wp-customize-nav-menus.php

    r42621 r43481  
    314314        // Prepend list of posts with nav_menus_created_posts search results on first page.
    315315        $nav_menus_created_posts_setting = $this->manager->get_setting( 'nav_menus_created_posts' );
    316         if ( 1 === $args['pagenum'] && $nav_menus_created_posts_setting && count( $nav_menus_created_posts_setting ) > 0 ) {
     316        if ( 1 === $args['pagenum'] && $nav_menus_created_posts_setting && count( $nav_menus_created_posts_setting->value() ) > 0 ) {
    317317            $stub_post_query = new WP_Query( array_merge(
    318318                $query,
  • branches/4.9/tests/phpunit/tests/customize/nav-menus.php

    r42621 r43481  
    293293    function test_search_available_items_query() {
    294294        $menus = new WP_Customize_Nav_Menus( $this->wp_customize );
     295        do_action( 'customize_register', $this->wp_customize );
    295296
    296297        // Create posts.
Note: See TracChangeset for help on using the changeset viewer.