From 7740e89de3e1bc0cc636120e3ca8ab9e97e4d3cc Mon Sep 17 00:00:00 2001 From: donncha Date: Fri, 4 Apr 2008 16:44:15 +0000 Subject: Merged with WordPress 2.5, unstable, only for testing git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1218 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/includes/misc.php | 80 +++------------------------------------------- 1 file changed, 4 insertions(+), 76 deletions(-) (limited to 'wp-admin/includes/misc.php') diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 23f998f..d38f308 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -1,18 +1,8 @@ flush_rules(); - // Clear cookies for old paths. - wp_clearcookie(); - // Set cookies for new paths. - wp_setcookie( $user_login, $user_pass_md5, true, get_option( 'home' ), get_option( 'siteurl' )); } add_action( 'update_option_home', 'update_home_siteurl', 10, 2 ); @@ -174,62 +160,4 @@ function wp_reset_vars( $vars ) { } } } - -function add_option_update_handler($option_group, $option_name, $sanitize_callback = '') { - global $new_whitelist_options, $sanitize_callbacks; - $new_whitelist_options[ $option_group ][] = $option_name; - if( $sanitize_callback != '' ) - add_filter( "sanitize_option_{$option_name}", $sanitize_callback ); -} - -function remove_option_update_handler($option_group, $option_name, $sanitize_callback = '') { - global $new_whitelist_options, $sanitize_callbacks; - $pos = array_search( $option_name, $new_whitelist_options ); - if( $pos !== false ) - unset( $new_whitelist_options[ $option_group ][ $pos ] ); - if( $sanitize_callback != '' ) - remove_filter( "sanitize_option_{$option_name}", $sanitize_callback ); -} - -function option_update_filter( $options ) { - global $new_whitelist_options; - - if( is_array( $new_whitelist_options ) ) - $options = add_option_whitelist( $new_whitelist_options, $options ); - - return $options; -} -add_filter( 'whitelist_options', 'option_update_filter' ); - -function add_option_whitelist( $new_options, $options = '' ) { - if( $options == '' ) { - global $whitelist_options; - } else { - $whitelist_options = $options; - } - foreach( $new_options as $page => $keys ) { - foreach( $keys as $key ) { - $pos = array_search( $key, $whitelist_options[ $page ] ); - if( $pos === false ) - $whitelist_options[ $page ][] = $key; - } - } - return $whitelist_options; -} - -function remove_option_whitelist( $del_options, $options = '' ) { - if( $options == '' ) { - global $whitelist_options; - } else { - $whitelist_options = $options; - } - foreach( $del_options as $page => $keys ) { - foreach( $keys as $key ) { - $pos = array_search( $key, $whitelist_options[ $page ] ); - if( $pos !== false ) - unset( $whitelist_options[ $page ][ $pos ] ); - } - } - return $whitelist_options; -} ?> -- cgit