Make WordPress Core

Changeset 39434


Ignore:
Timestamp:
12/02/2016 04:17:03 PM (8 years ago)
Author:
westonruter
Message:

Customize: Fix posts limit query arg for WP_Query from incorrect number to posts_per_page.

Props dlh.
Fixes #39022.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r39411 r39434  
    795795            'post_status' => get_post_stati(),
    796796            'name' => $uuid,
    797             'number' => 1,
     797            'posts_per_page' => 1,
    798798            'no_found_rows' => true,
    799799            'cache_results' => true,
     
    10041004                'post_status' => 'auto-draft',
    10051005                'post_type' => 'any',
    1006                 'number' => -1,
     1006                'posts_per_page' => -1,
    10071007            ) );
    10081008            foreach ( $existing_posts_query->posts as $existing_post ) {
     
    10171017                'post_status' => array_diff( get_post_stati(), array( 'auto-draft' ) ),
    10181018                'post_type' => 'any',
    1019                 'number' => -1,
     1019                'posts_per_page' => -1,
    10201020            ) );
    10211021            foreach ( $existing_posts_query->posts as $existing_post ) {
  • trunk/tests/phpunit/tests/customize/manager.php

    r39411 r39434  
    403403        );
    404404
     405        update_option( 'posts_per_page', 1 ); // To check #39022.
    405406        add_theme_support( 'starter-content', $starter_content_config );
    406407        $this->assertEmpty( $wp_customize->unsanitized_post_values() );
Note: See TracChangeset for help on using the changeset viewer.