Keep the same name and remove unused core, see [10987]

git-svn-id: http://svn.automattic.com/wordpress/trunk@10988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2009-04-17 12:55:03 +00:00
parent 3650836f09
commit 5563639dd5
3 changed files with 2 additions and 35 deletions

View File

@ -1025,39 +1025,6 @@ case 'meta-box-order':
if ( $page_columns )
update_usermeta($user->ID, "screen_layout_$page", $page_columns);
die('1');
break;
case 'set-screen-option':
check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' );
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':
case 'categories_per_page':
case 'edit_tags_per_page':
$value = (int) $value;
if ( $value < 1 || $value > 999 )
die(-1);
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':

View File

@ -41,7 +41,7 @@ nocache_headers();
update_category_cache();
save_screen_options();
set_screen_options();
$posts_per_page = get_option('posts_per_page');
$what_to_show = get_option('what_to_show');

View File

@ -323,7 +323,7 @@ jQuery('#template').submit(function(){
*
* @since 2.8
**/
function save_screen_options() {
function set_screen_options() {
if ( isset($_POST['wp_screen_options']) && is_array($_POST['wp_screen_options']) ) {
check_admin_referer( 'screen-options-nonce', 'screenoptionnonce' );