WordPress.org

Making WordPress.org

Ticket #496: 496.2.diff

File 496.2.diff, 1.3 KB (added by SergeyBiryukov, 4 years ago)
  • wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

     
    669669
    670670                // Unless otherwise specified, we start off by querying for publish'd plugins.
    671671                if ( empty( $wp_query->query_vars['pagename'] ) && ( empty( $wp_query->query_vars['post_type'] ) || 'post' == $wp_query->query_vars['post_type'] ) ) {
    672                         $wp_query->query_vars['post_type']   = array( 'plugin' );
     672                        $wp_query->query_vars['post_type']   = 'plugin';
    673673                        $wp_query->query_vars['post_status'] = array( 'publish' );
    674674                }
    675675
     
    813813         * Stops search crawlers from paginating through the entire DB.
    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'] ) && 'plugin' === $wp_query->query_vars['post_type'] ) {
    817817                        return min( $found_posts, 99 * $wp_query->query_vars['posts_per_page'] ); // 99 pages
    818818                }
    819819