WordPress.org

Make WordPress Core

Ticket #16416: 16416.general.2.diff

File 16416.general.2.diff, 12.7 KB (added by mbijon, 6 years ago)

Like this

  • wp-admin/includes/plugin.php

     
    16281628                $option_group = 'general';
    16291629        }
    16301630
     1631        if ( 'privacy' == $option_group ) {
     1632                _deprecated_argument( __FUNCTION__, '3.0', __( 'The privacy options group has been removed. Use another settings group.' ) );
     1633                $option_group = 'general';
     1634        }
     1635
    16311636        $new_whitelist_options[ $option_group ][] = $option_name;
    16321637        if ( $sanitize_callback != '' )
    16331638                add_filter( "sanitize_option_{$option_name}", $sanitize_callback );
     
    16511656                $option_group = 'general';
    16521657        }
    16531658
     1659        if ( 'privacy' == $option_group ) {
     1660                _deprecated_argument( __FUNCTION__, '3.0', __( 'The privacy options group has been removed. Use another settings group.' ) );
     1661                $option_group = 'general';
     1662        }
     1663
    16541664        $pos = array_search( $option_name, (array) $new_whitelist_options );
    16551665        if ( $pos !== false )
    16561666                unset( $new_whitelist_options[ $option_group ][ $pos ] );
  • wp-admin/includes/template.php

     
    10441044                $page = 'general';
    10451045        }
    10461046
     1047        if ( 'privacy' == $page ) {
     1048                _deprecated_argument( __FUNCTION__, '3.0', __( 'The privacy options group has been removed. Use another settings group.' ) );
     1049                $page = 'general';
     1050        }
     1051
    10471052        if ( !isset($wp_settings_sections) )
    10481053                $wp_settings_sections = array();
    10491054        if ( !isset($wp_settings_sections[$page]) )
     
    10841089                $page = 'general';
    10851090        }
    10861091
     1092        if ( 'privacy' == $page ) {
     1093                _deprecated_argument( __FUNCTION__, '3.0', __( 'The privacy options group has been removed. Use another settings group.' ) );
     1094                $page = 'general';
     1095        }
     1096
    10871097        if ( !isset($wp_settings_fields) )
    10881098                $wp_settings_fields = array();
    10891099        if ( !isset($wp_settings_fields[$page]) )
  • wp-admin/menu.php

     
    206206        $submenu['options-general.php'][20] = array(__('Reading'), 'manage_options', 'options-reading.php');
    207207        $submenu['options-general.php'][25] = array(__('Discussion'), 'manage_options', 'options-discussion.php');
    208208        $submenu['options-general.php'][30] = array(__('Media'), 'manage_options', 'options-media.php');
    209         $submenu['options-general.php'][35] = array(__('Privacy'), 'manage_options', 'options-privacy.php');
    210209        $submenu['options-general.php'][40] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
    211210
    212211$_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group
  • wp-admin/options-general.php

     
    77 */
    88
    99/** WordPress Administration Bootstrap */
    10 require_once('./admin.php');
     10require_once( './admin.php' );
    1111
    1212if ( ! current_user_can( 'manage_options' ) )
    1313        wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
    1414
    15 $title = __('General Settings');
     15$title = __( 'General Settings' );
    1616$parent_file = 'options-general.php';
    1717/* translators: date and time format for exact current time, mainly about timezones, see http://php.net/date */
    18 $timezone_format = _x('Y-m-d G:i:s', 'timezone date format');
     18$timezone_format = _x( 'Y-m-d G:i:s', 'timezone date format' );
    1919
    2020/**
    2121 * Display JavaScript on the page.
     
    5656</script>
    5757<?php
    5858}
    59 add_action('admin_head', 'add_js');
     59add_action( 'admin_head', 'add_js' );
    6060
    6161$options_help = '<p>' . __('The fields on this screen determine some of the basics of your site setup.') . '</p>' .
    6262        '<p>' . __('Most themes display the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. The tagline is also displayed by many themes.') . '</p>';
     
    7575        'content' => $options_help,
    7676) );
    7777
     78get_current_screen()->add_help_tab( array(
     79        'id'      => 'site-visibility',
     80        'title'   => __( 'Site Visibility' ),
     81        'content' => '<p>' . __( 'You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the radio button next to &#8220;Ask search engines not to index this site&#8221; and click the Save Changes button at the bottom of the screen. Note that your privacy is not complete; your site is still visible on the web.' ) . '</p>' .
     82                '<p>' . __( 'When this setting is in effect a reminder is shown in the Right Now box of the Dashboard that says, &#8220;Search Engines Blocked,&#8221; to remind you that your site is not being crawled.' ) . '</p>',
     83) );
     84
    7885get_current_screen()->set_help_sidebar(
    7986        '<p><strong>' . __('For more information:') . '</strong></p>' .
    8087        '<p>' . __('<a href="http://codex.wordpress.org/Settings_General_Screen" target="_blank">Documentation on General Settings</a>') . '</p>' .
    8188        '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    8289);
    8390
    84 include('./admin-header.php');
     91include( './admin-header.php' );
    8592?>
    8693
    8794<div class="wrap">
     
    143150<?php endif; ?>
    144151</td>
    145152</tr>
    146 <?php } ?>
     153<?php }
     154
     155// Allow display of 'Site Visibility' to be halted/changed
     156add_filter( 'display_site_visibility', 'display_site_visibility_content', 10, 2 );
     157function display_site_visibility_content( $output = '', $display = true ) {
     158        if ( ! $output && $display ):
     159                $output .= '<input id="blog-public" type="radio" name="blog_public" value="1" ' . checked( '1', get_option( 'blog_public' ), false ) . ' />';
     160                $output .= '<label for="blog-public">' . __( 'Allow search engines to index this site.' ) . '</label><br/>';
     161                $output .= '<input id="blog-norobots" type="radio" name="blog_public" value="0" ' . checked( '0', get_option( 'blog_public' ), false ) . ' />';
     162                $output .= '<label for="blog-norobots">' . __( 'Ask search engines not to index this site.' ) . '</label>';
     163                $output .= '<p class="description">' . __( 'Note: Neither of these options blocks access to your site &mdash; it is up to search engines to honor your request.' ) . '</p>';
     164               
     165                return $output;
     166       
     167        elseif ( $display ):
     168                return $output;
     169        else:
     170                return false;
     171        endif;
     172} ?>
     173<tr valign="top">
     174<th scope="row"><?php _e( 'Site Visibility' ); ?></th>
     175<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Site Visibility' ); ?></span></legend>
     176<?php
     177// Output default privacy options, alternates, or cancel
     178$output = apply_filters( 'display_site_visibility', '', true );
     179echo ( $output ? $output : '' );
     180
     181// Output any added privacy options from plugins
     182do_action( 'blog_privacy_selector' );
     183?>
     184</fieldset></td>
     185</tr>
     186
     187<?php do_settings_fields( 'general', 'default' ); ?>
     188</table>
     189
     190<h3><?php _e( 'Date and Time' ); ?></h3>
     191
     192<table class="form-table">
    147193<tr>
    148194<?php
    149 $current_offset = get_option('gmt_offset');
    150 $tzstring = get_option('timezone_string');
     195$current_offset = get_option( 'gmt_offset' );
     196$tzstring = get_option( 'timezone_string' );
    151197
    152198$check_zone_info = true;
    153199
     
    300346?>
    301347</select></td>
    302348</tr>
    303 <?php do_settings_fields('general', 'default'); ?>
    304349<?php
    305350        $languages = get_available_languages();
    306351        if ( is_multisite() && !empty( $languages ) ):
  • wp-admin/options-privacy.php

     
    1 <?php
    2 /**
    3  * Privacy Options Settings Administration Screen.
    4  *
    5  * @package WordPress
    6  * @subpackage Administration
    7  */
    8 
    9 /** Load WordPress Administration Bootstrap */
    10 require_once('./admin.php');
    11 
    12 if ( ! current_user_can( 'manage_options' ) )
    13         wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
    14 
    15 $title = __('Privacy Settings');
    16 $parent_file = 'options-general.php';
    17 
    18 get_current_screen()->add_help_tab( array(
    19         'id'      => 'overview',
    20         'title'   => __('Overview'),
    21         'content' => '<p>' . __('You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the radio button next to &#8220;Ask search engines not to index this site&#8221; and click the Save Changes button at the bottom of the screen. Note that your privacy is not complete; your site is still visible on the web.') . '</p>' .
    22                 '<p>' . __('When this setting is in effect a reminder is shown in the Right Now box of the Dashboard that says, &#8220;Search Engines Blocked,&#8221; to remind you that your site is not being crawled.') . '</p>',
    23 ) );
    24 
    25 get_current_screen()->set_help_sidebar(
    26         '<p><strong>' . __('For more information:') . '</strong></p>' .
    27         '<p>' . __('<a href="http://codex.wordpress.org/Settings_Privacy_Screen" target="_blank">Documentation on Privacy Settings</a>') . '</p>' .
    28         '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
    29 );
    30 
    31 include('./admin-header.php');
    32 ?>
    33 
    34 <div class="wrap">
    35 <?php screen_icon(); ?>
    36 <h2><?php echo esc_html( $title ); ?></h2>
    37 
    38 <form method="post" action="options.php">
    39 <?php settings_fields('privacy'); ?>
    40 
    41 <table class="form-table">
    42 <tr valign="top">
    43 <th scope="row"><?php _e( 'Site Visibility' ); ?> </th>
    44 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Site Visibility' ); ?> </span></legend>
    45 <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> />
    46 <label for="blog-public"><?php _e( 'Allow search engines to index this site.' );?></label><br/>
    47 <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> />
    48 <label for="blog-norobots"><?php _e( 'Ask search engines not to index this site.' ); ?></label>
    49 <p class="description"><?php _e( 'Note: Neither of these options blocks access to your site &mdash; it is up to search engines to honor your request.' ); ?></p>
    50 <?php do_action('blog_privacy_selector'); ?>
    51 </fieldset></td>
    52 </tr>
    53 <?php do_settings_fields('privacy', 'default'); ?>
    54 </table>
    55 
    56 <?php do_settings_sections('privacy'); ?>
    57 
    58 <?php submit_button(); ?>
    59 </form>
    60 
    61 </div>
    62 
    63 <?php include('./admin-footer.php') ?>
  • wp-admin/options.php

     
    5959        wp_die(__('Cheatin&#8217; uh?'));
    6060
    6161$whitelist_options = array(
    62         'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ),
     62        'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'blog_public' ),
    6363        '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' ),
    6464        'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', 'embed_autourls', 'embed_size_w', 'embed_size_h' ),
    65         'privacy' => array( 'blog_public' ),
    6665        'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),
    6766        'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format', 'enable_app', 'enable_xmlrpc' ),
    68         'options' => array( '' ) );
     67);
     68$whitelist_options['misc'] = $whitelist_options['options'] = $whitelist_options['privacy'] = array();
    6969
    7070$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass');
    7171$uploads_options = array('uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path');
     
    9090
    9191        if ( apply_filters( 'enable_post_by_email_configuration', true ) )
    9292                $whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options);
    93 
    94         $whitelist_options[ 'misc' ] = array();
    9593}
    9694
    9795$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );