mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Fix per_page screen option for custom post types and taxonomies. Don't convert taxonomy and post type slugs from hyphen to underscore when saving the per_page usermeta. Props nacin. see #18958
git-svn-id: https://develop.svn.wordpress.org/trunk@21322 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -328,15 +328,15 @@ function set_screen_options() {
|
||||
if ( !preg_match( '/^[a-z_-]+$/', $option ) )
|
||||
return;
|
||||
|
||||
$option = str_replace('-', '_', $option);
|
||||
|
||||
$map_option = $option;
|
||||
$type = str_replace('edit_', '', $map_option);
|
||||
$type = str_replace('_per_page', '', $type);
|
||||
if ( in_array($type, get_post_types()) )
|
||||
$map_option = 'edit_per_page';
|
||||
if ( in_array( $type, get_taxonomies()) )
|
||||
if ( in_array( $type, get_taxonomies() ) )
|
||||
$map_option = 'edit_tags_per_page';
|
||||
elseif ( in_array( $type, get_post_types() ) )
|
||||
$map_option = 'edit_per_page';
|
||||
else
|
||||
$option = str_replace('-', '_', $option);
|
||||
|
||||
switch ( $map_option ) {
|
||||
case 'edit_per_page':
|
||||
|
||||
Reference in New Issue
Block a user