Fold Privacy Settings into Reading Settings, moving blog_public (search engine/robots) to options-reading and removing options-privacy.

When blog_public only has two values (as judged by whether the blog_privacy_selector action is used), convert from radio buttons to a checkbox, and rename from 'Site Visibility' to a more specific 'Search Engine Visibility'.

The text and implementation may change a bit. see #16416.



git-svn-id: http://core.svn.wordpress.org/trunk@21838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-09-13 17:28:57 +00:00
parent 8886eef8d9
commit 7fd32ab9fc
8 changed files with 57 additions and 79 deletions

View File

@ -392,12 +392,12 @@ function wp_dashboard_right_now() {
}
echo '</p>';
// Check if search engines are blocked.
// Check if search engines are asked not to index this site.
if ( !is_network_admin() && !is_user_admin() && current_user_can('manage_options') && '1' != get_option('blog_public') ) {
$title = apply_filters('privacy_on_link_title', __('Your site is asking search engines not to index its content') );
$content = apply_filters('privacy_on_link_text', __('Search Engines Blocked') );
$content = apply_filters('privacy_on_link_text', __('Search Engines Discouraged') );
echo "<p><a href='options-privacy.php' title='$title'>$content</a></p>";
echo "<p><a href='options-reading.php' title='$title'>$content</a></p>";
}
update_right_now_message();
@ -1260,7 +1260,6 @@ function wp_welcome_panel() {
<h4><span class="icon16 icon-settings"></span> <?php _e( 'Basic Settings' ); ?></h4>
<p><?php _e( 'Here are a few easy things you can do to get your feet wet. Make sure to click Save on each Settings screen.' ); ?></p>
<ul>
<li><?php echo sprintf( __( '<a href="%s">Choose your privacy setting</a>' ), esc_url( admin_url('options-privacy.php') ) ); ?></li>
<li><?php echo sprintf( __( '<a href="%s">Select your tagline and time zone</a>' ), esc_url( admin_url('options-general.php') ) ); ?></li>
<li><?php echo sprintf( __( '<a href="%s">Turn comments on or off</a>' ), esc_url( admin_url('options-discussion.php') ) ); ?></li>
<li><?php echo sprintf( __( '<a href="%s">Fill in your profile</a>' ), esc_url( get_edit_profile_url( get_current_user_id() ) ) ); ?></li>

View File

@ -1624,10 +1624,15 @@ function register_setting( $option_group, $option_name, $sanitize_callback = ''
global $new_whitelist_options;
if ( 'misc' == $option_group ) {
_deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) );
_deprecated_argument( __FUNCTION__, '3.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) );
$option_group = 'general';
}
if ( 'privacy' == $option_group ) {
_deprecated_argument( __FUNCTION__, '3.5', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) );
$option_group = 'reading';
}
$new_whitelist_options[ $option_group ][] = $option_name;
if ( $sanitize_callback != '' )
add_filter( "sanitize_option_{$option_name}", $sanitize_callback );
@ -1647,10 +1652,15 @@ function unregister_setting( $option_group, $option_name, $sanitize_callback = '
global $new_whitelist_options;
if ( 'misc' == $option_group ) {
_deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) );
_deprecated_argument( __FUNCTION__, '3.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) );
$option_group = 'general';
}
if ( 'privacy' == $option_group ) {
_deprecated_argument( __FUNCTION__, '3.5', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) );
$option_group = 'reading';
}
$pos = array_search( $option_name, (array) $new_whitelist_options );
if ( $pos !== false )
unset( $new_whitelist_options[ $option_group ][ $pos ] );

View File

@ -1040,10 +1040,15 @@ function add_settings_section($id, $title, $callback, $page) {
global $wp_settings_sections;
if ( 'misc' == $page ) {
_deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) );
_deprecated_argument( __FUNCTION__, '3.0', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) );
$page = 'general';
}
if ( 'privacy' == $page ) {
_deprecated_argument( __FUNCTION__, '3.5', sprintf( __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) );
$page = 'reading';
}
if ( !isset($wp_settings_sections) )
$wp_settings_sections = array();
if ( !isset($wp_settings_sections[$page]) )
@ -1084,6 +1089,11 @@ function add_settings_field($id, $title, $callback, $page, $section = 'default',
$page = 'general';
}
if ( 'privacy' == $page ) {
_deprecated_argument( __FUNCTION__, '3.5', __( 'The privacy options group has been removed. Use another settings group.' ) );
$page = 'reading';
}
if ( !isset($wp_settings_fields) )
$wp_settings_fields = array();
if ( !isset($wp_settings_fields[$page]) )

View File

@ -206,7 +206,6 @@ $menu[80] = array( __('Settings'), 'manage_options', 'options-general.php', '',
$submenu['options-general.php'][20] = array(__('Reading'), 'manage_options', 'options-reading.php');
$submenu['options-general.php'][25] = array(__('Discussion'), 'manage_options', 'options-discussion.php');
$submenu['options-general.php'][30] = array(__('Media'), 'manage_options', 'options-media.php');
$submenu['options-general.php'][35] = array(__('Privacy'), 'manage_options', 'options-privacy.php');
$submenu['options-general.php'][40] = array(__('Permalinks'), 'manage_options', 'options-permalink.php');
$_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group

View File

@ -1,63 +0,0 @@
<?php
/**
* Privacy Options Settings Administration Screen.
*
* @package WordPress
* @subpackage Administration
*/
/** Load WordPress Administration Bootstrap */
require_once('./admin.php');
if ( ! current_user_can( 'manage_options' ) )
wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
$title = __('Privacy Settings');
$parent_file = 'options-general.php';
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'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>' .
'<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>',
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Settings_Privacy_Screen" target="_blank">Documentation on Privacy Settings</a>') . '</p>' .
'<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
);
include('./admin-header.php');
?>
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form method="post" action="options.php">
<?php settings_fields('privacy'); ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e( 'Site Visibility' ); ?> </th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Site Visibility' ); ?> </span></legend>
<input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> />
<label for="blog-public"><?php _e( 'Allow search engines to index this site.' );?></label><br/>
<input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> />
<label for="blog-norobots"><?php _e( 'Ask search engines not to index this site.' ); ?></label>
<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>
<?php do_action('blog_privacy_selector'); ?>
</fieldset></td>
</tr>
<?php do_settings_fields('privacy', 'default'); ?>
</table>
<?php do_settings_sections('privacy'); ?>
<?php submit_button(); ?>
</form>
</div>
<?php include('./admin-footer.php') ?>

View File

@ -50,6 +50,13 @@ get_current_screen()->add_help_tab( array(
'<p>' . __('You must click the Save Changes button at the bottom of the screen for new settings to take effect.') . '</p>',
) );
get_current_screen()->add_help_tab( array(
'id' => 'site-visibility',
'title' => has_action( 'blog_privacy_selector' ) ? __( 'Site Visibility' ) : __( 'Search Engine Visibility' ),
'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>' .
'<p>' . __( 'When this setting is in effect a reminder is shown in the Right Now box of the Dashboard that says, &#8220;Search Engines Discouraged,&#8221; to remind you that your site is not being crawled.' ) . '</p>',
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="http://codex.wordpress.org/Settings_Reading_Screen" target="_blank">Documentation on Reading Settings</a>') . '</p>' .
@ -63,7 +70,7 @@ include( './admin-header.php' );
<?php screen_icon(); ?>
<h2><?php echo esc_html( $title ); ?></h2>
<form name="form1" method="post" action="options.php">
<form method="post" action="options.php">
<?php
settings_fields( 'reading' );
@ -132,6 +139,24 @@ else :
</fieldset></td>
</tr>
<tr valign="top">
<th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </th>
<td><fieldset><legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend>
<?php if ( has_action( 'blog_privacy_selector' ) ) : ?>
<input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> />
<label for="blog-public"><?php _e( 'Allow search engines to index this site.' );?></label><br/>
<input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> />
<label for="blog-norobots"><?php _e( 'Ask search engines not to index this site.' ); ?></label>
<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>
<?php do_action('blog_privacy_selector'); ?>
<?php else : ?>
<label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="1" <?php checked( '1', get_option( 'blog_public' ) ); ?> />
<?php _e( 'Allow search engines to index this site' ); ?>
<p class="description"><?php _e( 'It is up to search engines to honor a request to not index this site.' ); ?></p>
<?php endif; ?>
</fieldset></td>
</tr>
<?php do_settings_fields( 'reading', 'default' ); ?>
</table>

View File

@ -182,7 +182,7 @@ wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_email_categor
<?php else : ?>
<p><?php printf(__('WordPress is not notifying any <a href="http://codex.wordpress.org/Update_Services">Update Services</a> because of your site&#8217;s <a href="%s">privacy settings</a>.'), 'options-privacy.php'); ?></p>
<p><?php printf(__('WordPress is not notifying any <a href="http://codex.wordpress.org/Update_Services">Update Services</a> because of your site&#8217;s <a href="%s">visibility settings</a>.'), 'options-reading.php'); ?></p>
<?php endif; ?>
<?php } // multisite ?>

View File

@ -62,10 +62,10 @@ $whitelist_options = array(
'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ),
'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' ),
'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' ),
'privacy' => array( 'blog_public' ),
'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),
'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format' ),
'options' => array( '' ) );
'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts', 'blog_public' ),
'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format' )
);
$whitelist_options['misc'] = $whitelist_options['options'] = $whitelist_options['privacy'] = array();
$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass');
$uploads_options = array('uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path');
@ -90,8 +90,6 @@ if ( !is_multisite() ) {
if ( apply_filters( 'enable_post_by_email_configuration', true ) )
$whitelist_options['writing'] = array_merge($whitelist_options['writing'], $mail_options);
$whitelist_options[ 'misc' ] = array();
}
$whitelist_options = apply_filters( 'whitelist_options', $whitelist_options );