WordPress.org

Make WordPress Core

Changeset 12825


Ignore:
Timestamp:
01/25/2010 09:33:49 PM (10 years ago)
Author:
ryan
Message:

Deprecate mu_options. Integrate directly into options.php. see #11644

Location:
trunk/wp-admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms-deprecated.php

    r12824 r12825  
    2929}
    3030
     31/**
     32 * @deprecated 3.0
     33 */
     34function mu_options( $options ) {
     35    _deprecated_function(__FUNCTION__, '3.0', '' );
     36    return $options;
     37}
     38
    3139?>
  • trunk/wp-admin/includes/ms.php

    r12824 r12825  
    562562}
    563563add_action( 'admin_page_access_denied', 'redirect_user_to_blog', 99 );
    564 
    565 function mu_options( $options ) {
    566     if ( defined( 'POST_BY_EMAIL' ) ) {
    567         $writing = array( 'ping_sites' );
    568     } else {
    569         $writing = array( 'ping_sites', 'mailserver_login', 'mailserver_pass', 'default_email_category', 'mailserver_port', 'mailserver_url' );
    570     }
    571     $removed = array(
    572         'general' => array( 'siteurl', 'home', 'admin_email', 'users_can_register', 'default_role' ),
    573         'reading' => array( 'gzipcompression' ),
    574         'writing' => $writing,
    575     );
    576 
    577     $added = array( 'general' => array( 'new_admin_email', 'WPLANG', 'language' ) );
    578 
    579     $options[ 'misc' ] = array();
    580 
    581     $options = remove_option_whitelist( $removed, $options );
    582     $options = add_option_whitelist( $added, $options );
    583 
    584     return $options;
    585 }
    586 add_filter( 'whitelist_options', 'mu_options' );
    587564
    588565function check_import_new_users( $permission ) {
  • trunk/wp-admin/includes/plugin.php

    r12789 r12825  
    10651065 */
    10661066function add_option_whitelist( $new_options, $options = '' ) {
    1067     if ( $options == '' ) {
     1067    if ( $options == '' )
    10681068        global $whitelist_options;
    1069     } else {
     1069    else
    10701070        $whitelist_options = $options;
    1071     }
    1072     foreach( $new_options as $page => $keys ) {
    1073         foreach( $keys as $key ) {
     1071
     1072    foreach ( $new_options as $page => $keys ) {
     1073        foreach ( $keys as $key ) {
    10741074            if ( !isset($whitelist_options[ $page ]) || !is_array($whitelist_options[ $page ]) ) {
    10751075                $whitelist_options[ $page ] = array();
     
    10821082        }
    10831083    }
     1084
    10841085    return $whitelist_options;
    10851086}
     
    10951096 */
    10961097function remove_option_whitelist( $del_options, $options = '' ) {
    1097     if ( $options == '' ) {
     1098    if ( $options == '' )
    10981099        global $whitelist_options;
    1099     } else {
     1100    else
    11001101        $whitelist_options = $options;
    1101     }
    1102     foreach( $del_options as $page => $keys ) {
    1103         foreach( $keys as $key ) {
     1102
     1103    foreach ( $del_options as $page => $keys ) {
     1104        foreach ( $keys as $key ) {
    11041105            if ( isset($whitelist_options[ $page ]) && is_array($whitelist_options[ $page ]) ) {
    11051106                $pos = array_search( $key, $whitelist_options[ $page ] );
     
    11091110        }
    11101111    }
     1112
    11111113    return $whitelist_options;
    11121114}
  • trunk/wp-admin/options.php

    r12789 r12825  
    2323
    2424$whitelist_options = array(
    25     'general' => array( 'blogname', 'blogdescription', 'admin_email', 'users_can_register', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'default_role', 'timezone_string' ),
     25    'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ),
    2626    'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ),
    2727    'misc' => array( 'use_linksupdate', 'uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path' ),
     
    2929    'privacy' => array( 'blog_public' ),
    3030    'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),
    31     'writing' => array( 'default_post_edit_rows', 'use_smilies', 'ping_sites', 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'enable_app', 'enable_xmlrpc' ),
     31    'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'enable_app', 'enable_xmlrpc' ),
    3232    'options' => array( '' ) );
    33 if ( !defined( 'WP_SITEURL' ) ) $whitelist_options['general'][] = 'siteurl';
    34 if ( !defined( 'WP_HOME' ) ) $whitelist_options['general'][] = 'home';
     33
     34$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass');
     35
     36if ( !is_multisite() ) {
     37    if ( !defined( 'WP_SITEURL' ) ) $whitelist_options['general'][] = 'siteurl';
     38    if ( !defined( 'WP_HOME' ) ) $whitelist_options['general'][] = 'home';
     39    $whitelist_options['general'][] = 'admin_email';
     40    $whitelist_options['general'][] = 'users_can_register';
     41    $whitelist_options['general'][] = 'default_role';
     42
     43    $whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options);
     44    $whitelist_options['writing'][] = 'ping_sites';
     45} else {
     46    $whitelist_options['general'][] = 'new_admin_email';
     47    $whitelist_options['general'][] = 'WPLANG';
     48    $whitelist_options['general'][] = 'language';
     49
     50    $whitelist_options[ 'misc' ] = array();
     51
     52    if ( defined( 'POST_BY_EMAIL' ) )
     53        $whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options);
     54
     55    $whitelist_options[ 'misc' ] = array();
     56}
    3557
    3658$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );
     
    3961    wp_die(__('Cheatin’ uh?'));
    4062
    41 if ( is_multisite() && is_super_admin() && $_GET[ 'adminhash' ] ) {
     63if ( is_multisite() && is_super_admin() && isset($_GET[ 'adminhash' ]) && $_GET[ 'adminhash' ] ) {
    4264    $new_admin_details = get_option( 'adminhash' );
    4365    if ( is_array( $new_admin_details ) && $new_admin_details[ 'hash' ] == $_GET[ 'adminhash' ] && $new_admin_details[ 'newemail' ] != '' ) {
Note: See TracChangeset for help on using the changeset viewer.