WordPress.org

Making WordPress.org

Changeset 5846


Ignore:
Timestamp:
08/30/2017 01:29:18 PM (4 years ago)
Author:
Otto42
Message:

Plugin Directory: Change check back to array, but add is_array check to prevent it from causing errors when the value is not actually an array. Fixes #496

File:
1 edited

Legend:

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

    r5841 r5846  
    814814     */
    815815    public function filter_found_posts( $found_posts, $wp_query ) {
    816         if ( isset( $wp_query->query['browse'] ) && $wp_query->query_vars['post_type'] == 'plugin' ) {
     816        if ( isset( $wp_query->query['browse'] ) && is_array( $wp_query->query_vars['post_type'] ) && in_array( 'plugin', $wp_query->query_vars['post_type'] ) ) {
    817817            return min( $found_posts, 99 * $wp_query->query_vars['posts_per_page'] ); // 99 pages
    818818        }
Note: See TracChangeset for help on using the changeset viewer.