[wp-trac] [WordPress Trac] #19469: The wp-admin theme chooser has a hard coded limit (of 15) and no filter
WordPress Trac
wp-trac at lists.automattic.com
Mon Feb 6 23:37:36 UTC 2012
#19469: The wp-admin theme chooser has a hard coded limit (of 15) and no filter
----------------------------+------------------
Reporter: willshouse | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.4
Component: Administration | Version: 2.7
Severity: normal | Resolution:
Keywords: has-patch |
----------------------------+------------------
Comment (by pagesimplify):
Not sure if it's counterproductive to add code changes here. I was about
to submit this as a ticket until I saw this reported. Slap me on the hand
as a first time offender if I'm going about this wrong.
References apply to WordPress 3.3.1
'''Change 1:''' Replace line with call to base class method using
'themes_per_page'.
Modify File: /wp-admin/includes/class-wp-themes-list-table.php
Replace line 50 seen below:
{{{
$per_page = 24;
}}}
With the following line:
{{{
$per_page = $this->get_items_per_page( 'themes_per_page',
24 );
}}}
This is consistent with the prepare_items() functions used in:
- Plugins: /wp-admin/includes/class-wp-plugins-list-table.php
- MS Themes: /wp-admin/includes/class-wp-ms-themes-list-table.php
'''Change 2:''' Add Screen Options for themes_per_page for non network
installation.
Modify File: /wp-admin/themes.php
Replace line 69 seen below:
{{{
add_thickbox();
}}}
With the following lines:
{{{
add_thickbox();
add_screen_option( 'per_page', array('label' => _x( 'Themes', 'themes per
page (screen options)' ), 'default' => 24 ) );
}}}
'''Change 3:''' Handle post back for saving themes per page.
Modify File: /wp-admin/includes/misc.php
Replace line 350 seen below:
{{{
case 'plugins_per_page':
}}}
With the following lines:
{{{
case 'plugins_per_page':
case 'themes_per_page':
}}}
'''Final Note:'''
By implementing this modification, the following filter will effectively
be called:
{{{
apply_filters( 'themes_per_page', $per_page );
}}}
From class WP_List_Table
{{{
function get_items_per_page( $option, $default = 20 )
}}}
in the file: /wp-admin/includes/class-wp-list-table.php
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19469#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list