Making WordPress.org


Ignore:
Timestamp:
12/05/2019 05:53:20 AM (7 years ago)
Author:
dd32
Message:

Plugin Directory: 0 and -1 are not valid posts_per_page for the purpose of this API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-query-plugins.php

    r9227 r9311  
    5858                if ( isset( $query['posts_per_page'] ) ) {
    5959                        $query['posts_per_page'] = min( $query['posts_per_page'], 250 );
     60
     61                        // 0 and -1 are not valid. Just drop the parameter.
     62                        if ( $query['posts_per_page'] <= 0 ) {
     63                                unset( $query['posts_per_page'] );
     64                        }
    6065                }
    6166
Note: See TracChangeset for help on using the changeset viewer.