1

When adding new plugins, the list is too short, and I have to click on next, next , next...

Is there a way to change the number of items to be displayed to something like 100 or 500?

enter image description here

1 Answer 1

2

You can filter the parameters for this view per install_plugins_table_api_args_search. See wp-admin/includes/class-wp-plugin-install-list-table.php for the details.

You get an array as argument that looks like this:

Array
(
    [page] => 1
    [per_page] => 30
    [fields] => Array
        (
            [last_updated] => 1
            [icons] => 1
            [active_installs] => 1
        )

    [locale] => en_US
    [installed_plugins] => Array
        (
            [0] => magic-widgets
            [1] => query-monitor
        )

    [search] => seo
)

So you can just set the per_page entry to a higher value. This will also slow down the response, because more data is transferred from wordpress.org.

Here is a sample plugin:

<?php # -*- coding: utf-8 -*-
/**
 * Plugin Name: 200 plugins per install search
 */

add_filter( 'install_plugins_table_api_args_search', function ( array $args ) {

    $args['per_page'] = 200;
    return $args;
});
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.