Making WordPress.org


Ignore:
Timestamp:
05/10/2024 12:51:33 AM (13 months ago)
Author:
dd32
Message:

Plugin Directory: Search: Attempt to show the actual number of search results, rather than capping out at 1020.

See https://github.com/WordPress/wordpress.org/issues/310

File:
1 edited

Legend:

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

    r13654 r13687  
    418418        }
    419419
     420        // Set the number of found plugins, ignoring pagination.
     421        $es_result = \Automattic\Jetpack\Search\Classic_Search::instance()->get_last_query_info();
     422        if ( $es_result && ! empty( $es_result['response']['results']['total'] ) ) {
     423            $query->found_posts = $es_result['response']['results']['total'];
     424        }
     425
    420426        return $posts;
    421427    }
Note: See TracChangeset for help on using the changeset viewer.