WordPress.org

Make WordPress Core

#25675 closed defect (bug) (fixed)

Fix pagination in install-plugins.php to work with the filter install_plugins_table_api_args_$tab

Reported by: brasofilo Owned by: SergeyBiryukov
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.8
Component: Plugins Keywords: has-patch
Focuses: administration Cc:

Description

We can modify the per_page value in different tabs of the Install Plugins screen using the hook install_plugins_table_api_args_$tab, but pagination does not reflect that.

Per page is add as an argument value in line 63

$args = array( 'page' => $paged, 'per_page' => $per_page );

The filter is applied on the arguments in line 118, but right after, in 132, the pagination args refer back to $per_page instead of $args['per_page'], which would produce the desired effect.

Attachments (1)

25675.patch (470 bytes) - added by brasofilo 17 months ago.
Per page in wp-admin/includes/class-wp-plugin-install-list-table.php

Download all attachments as: .zip

Change History (5)

@brasofilo17 months ago

Per page in wp-admin/includes/class-wp-plugin-install-list-table.php

comment:1 @ericlewis13 months ago

  • Focuses administration added

Yep. Patch looks good.

Removing the definition of $per_page = 30; as well would clean up the code here, though that might be unnecessary refactoring.

comment:2 @mordauk13 months ago

Patch looks good to me.

comment:3 @SergeyBiryukov13 months ago

  • Milestone changed from Awaiting Review to 3.9

comment:4 @SergeyBiryukov13 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 27221:

Use filtered per_page value in WP_Plugin_Install_List_Table and WP_Theme_Install_List_Table.

props brasofilo.
fixes #25675.

Note: See TracTickets for help on using tickets.