"[ ] Discourage search engines from indexing this site". fixes #16416.

git-svn-id: https://develop.svn.wordpress.org/trunk@21851 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-09-14 20:26:20 +00:00
parent 8c13f286e3
commit 42a2b4a12f
2 changed files with 13 additions and 5 deletions

View File

@ -142,15 +142,15 @@ else :
<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/>
<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>
<label for="blog-norobots"><?php _e( 'Discourage search engines from indexing 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>
<label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> />
<?php _e( 'Discourage search engines from indexing this site' ); ?></label>
<p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p>
<?php endif; ?>
</fieldset></td>
</tr>

View File

@ -2797,6 +2797,14 @@ function sanitize_option($option, $value) {
$value = preg_replace('/[^a-zA-Z0-9_-]/', '', $value); // strips slashes
break;
case 'blog_public':
// This is the value if the settings checkbox is not checked on POST. Don't rely on this.
if ( null === $value )
$value = 1;
else
$value = intval( $value );
break;
case 'date_format':
case 'time_format':
case 'mailserver_url':