Add per page option to Screen Options for comments, posts, pages, and media.

git-svn-id: https://develop.svn.wordpress.org/trunk@10847 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2009-03-27 22:47:47 +00:00
parent d861062501
commit ea904a0ba0
7 changed files with 98 additions and 5 deletions
+28
View File
@@ -1021,6 +1021,34 @@ case 'meta-box-order':
if ( $page_columns )
update_usermeta($user->ID, "screen_layout_$page", $page_columns);
die('1');
break;
case 'set-screen-option':
if ( ! $user = wp_get_current_user() )
die(-1);
$option = $_POST['option'];
$value = $_POST['value'];
if ( !preg_match( '/^[a-z_-]+$/', $option ) )
die(-1);
$option = str_replace('-', '_', $option);
switch ( $option ) {
case 'edit_per_page':
case 'edit_pages_per_page':
case 'edit_comments_per_page':
case 'upload_per_page':
$value = (int) $value;
break;
default:
$value = apply_filters('set-screen-option', false, $option, $value);
if ( false === $value )
die(-1);
break;
}
update_usermeta($user->ID, $option, $value);
die('1');
break;
case 'get-permalink':