wp/wp-admin/options-reading.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
    30 				'post-new.php?post_type=page'
    30 				'post-new.php?post_type=page'
    31 			) . '</p>' .
    31 			) . '</p>' .
    32 			'<p>' . sprintf(
    32 			'<p>' . sprintf(
    33 				/* translators: %s: Documentation URL. */
    33 				/* translators: %s: Documentation URL. */
    34 				__( 'You can also control the display of your content in RSS feeds, including the maximum number of posts to display and whether to show full text or an excerpt. <a href="%s">Learn more about feeds</a>.' ),
    34 				__( 'You can also control the display of your content in RSS feeds, including the maximum number of posts to display and whether to show full text or an excerpt. <a href="%s">Learn more about feeds</a>.' ),
    35 				__( 'https://wordpress.org/support/article/wordpress-feeds/' )
    35 				__( 'https://developer.wordpress.org/advanced-administration/wordpress/feeds/' )
    36 			) . '</p>' .
    36 			) . '</p>' .
    37 			'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
    37 			'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
    38 	)
    38 	)
    39 );
    39 );
    40 
    40 
    48 	)
    48 	)
    49 );
    49 );
    50 
    50 
    51 get_current_screen()->set_help_sidebar(
    51 get_current_screen()->set_help_sidebar(
    52 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    52 	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    53 	'<p>' . __( '<a href="https://wordpress.org/support/article/settings-reading-screen/">Documentation on Reading Settings</a>' ) . '</p>' .
    53 	'<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-reading-screen/">Documentation on Reading Settings</a>' ) . '</p>' .
    54 	'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
    54 	'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
    55 );
    55 );
    56 
    56 
    57 require_once ABSPATH . 'wp-admin/admin-header.php';
    57 require_once ABSPATH . 'wp-admin/admin-header.php';
    58 ?>
    58 ?>
    59 
    59 
    62 
    62 
    63 <form method="post" action="options.php">
    63 <form method="post" action="options.php">
    64 <?php
    64 <?php
    65 settings_fields( 'reading' );
    65 settings_fields( 'reading' );
    66 
    66 
    67 if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ) ) {
    67 if ( ! is_utf8_charset() ) {
    68 	add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) );
    68 	add_settings_field( 'blog_charset', __( 'Encoding for pages and feeds' ), 'options_reading_blog_charset', 'reading', 'default', array( 'label_for' => 'blog_charset' ) );
    69 }
    69 }
    70 ?>
    70 ?>
    71 
    71 
    72 <?php if ( ! get_pages() ) : ?>
    72 <?php if ( ! get_pages() ) : ?>
    83 	}
    83 	}
    84 	?>
    84 	?>
    85 <table class="form-table" role="presentation">
    85 <table class="form-table" role="presentation">
    86 <tr>
    86 <tr>
    87 <th scope="row"><?php _e( 'Your homepage displays' ); ?></th>
    87 <th scope="row"><?php _e( 'Your homepage displays' ); ?></th>
    88 <td id="front-static-pages"><fieldset><legend class="screen-reader-text"><span><?php _e( 'Your homepage displays' ); ?></span></legend>
    88 <td id="front-static-pages"><fieldset>
       
    89 	<legend class="screen-reader-text"><span>
       
    90 		<?php
       
    91 		/* translators: Hidden accessibility text. */
       
    92 		_e( 'Your homepage displays' );
       
    93 		?>
       
    94 	</span></legend>
    89 	<p><label>
    95 	<p><label>
    90 		<input name="show_on_front" type="radio" value="posts" class="tog" <?php checked( 'posts', get_option( 'show_on_front' ) ); ?> />
    96 		<input name="show_on_front" type="radio" value="posts" class="tog" <?php checked( 'posts', get_option( 'show_on_front' ) ); ?> />
    91 		<?php _e( 'Your latest posts' ); ?>
    97 		<?php _e( 'Your latest posts' ); ?>
    92 	</label>
    98 	</label>
    93 	</p>
    99 	</p>
   136 		)
   142 		)
   137 	);
   143 	);
   138 	?>
   144 	?>
   139 </label></li>
   145 </label></li>
   140 </ul>
   146 </ul>
   141 	<?php if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) === get_option( 'page_on_front' ) ) : ?>
   147 	<?php
   142 	<div id="front-page-warning" class="notice notice-warning inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>
   148 	if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) === get_option( 'page_on_front' ) ) :
   143 	<?php endif; ?>
   149 		wp_admin_notice(
   144 	<?php if ( get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_for_posts' ) || get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_on_front' ) ) : ?>
   150 			__( '<strong>Warning:</strong> these pages should not be the same!' ),
   145 	<div id="privacy-policy-page-warning" class="notice notice-warning inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same as your Privacy Policy page!' ); ?></p></div>
   151 			array(
   146 	<?php endif; ?>
   152 				'type'               => 'warning',
       
   153 				'id'                 => 'front-page-warning',
       
   154 				'additional_classes' => array( 'inline' ),
       
   155 			)
       
   156 		);
       
   157 	endif;
       
   158 	if ( get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_for_posts' ) || get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_on_front' ) ) :
       
   159 		wp_admin_notice(
       
   160 			__( '<strong>Warning:</strong> these pages should not be the same as your Privacy Policy page!' ),
       
   161 			array(
       
   162 				'type'               => 'warning',
       
   163 				'id'                 => 'privacy-policy-page-warning',
       
   164 				'additional_classes' => array( 'inline' ),
       
   165 			)
       
   166 		);
       
   167 	endif;
       
   168 	?>
   147 </fieldset></td>
   169 </fieldset></td>
   148 </tr>
   170 </tr>
   149 <?php endif; ?>
   171 <?php endif; ?>
   150 <tr>
   172 <tr>
   151 <th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th>
   173 <th scope="row"><label for="posts_per_page"><?php _e( 'Blog pages show at most' ); ?></label></th>
   157 <th scope="row"><label for="posts_per_rss"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th>
   179 <th scope="row"><label for="posts_per_rss"><?php _e( 'Syndication feeds show the most recent' ); ?></label></th>
   158 <td><input name="posts_per_rss" type="number" step="1" min="1" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td>
   180 <td><input name="posts_per_rss" type="number" step="1" min="1" id="posts_per_rss" value="<?php form_option( 'posts_per_rss' ); ?>" class="small-text" /> <?php _e( 'items' ); ?></td>
   159 </tr>
   181 </tr>
   160 <tr>
   182 <tr>
   161 <th scope="row"><?php _e( 'For each post in a feed, include' ); ?> </th>
   183 <th scope="row"><?php _e( 'For each post in a feed, include' ); ?> </th>
   162 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'For each post in a feed, include' ); ?> </span></legend>
   184 <td><fieldset>
       
   185 	<legend class="screen-reader-text"><span>
       
   186 		<?php
       
   187 		/* translators: Hidden accessibility text. */
       
   188 		_e( 'For each post in a feed, include' );
       
   189 		?>
       
   190 	</span></legend>
   163 	<p>
   191 	<p>
   164 		<label><input name="rss_use_excerpt" type="radio" value="0" <?php checked( 0, get_option( 'rss_use_excerpt' ) ); ?>	/> <?php _e( 'Full text' ); ?></label><br />
   192 		<label><input name="rss_use_excerpt" type="radio" value="0" <?php checked( 0, get_option( 'rss_use_excerpt' ) ); ?>	/> <?php _e( 'Full text' ); ?></label><br />
   165 		<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Excerpt' ); ?></label>
   193 		<label><input name="rss_use_excerpt" type="radio" value="1" <?php checked( 1, get_option( 'rss_use_excerpt' ) ); ?> /> <?php _e( 'Excerpt' ); ?></label>
   166 	</p>
   194 	</p>
   167 	<p class="description">
   195 	<p class="description">
   168 		<?php
   196 		<?php
   169 		printf(
   197 		printf(
   170 			/* translators: %s: Documentation URL. */
   198 			/* translators: %s: Documentation URL. */
   171 			__( 'Your theme determines how content is displayed in browsers. <a href="%s">Learn more about feeds</a>.' ),
   199 			__( 'Your theme determines how content is displayed in browsers. <a href="%s">Learn more about feeds</a>.' ),
   172 			__( 'https://wordpress.org/support/article/wordpress-feeds/' )
   200 			__( 'https://developer.wordpress.org/advanced-administration/wordpress/feeds/' )
   173 		);
   201 		);
   174 		?>
   202 		?>
   175 	</p>
   203 	</p>
   176 </fieldset></td>
   204 </fieldset></td>
   177 </tr>
   205 </tr>
   178 
   206 
   179 <tr class="option-site-visibility">
   207 <tr class="option-site-visibility">
   180 <th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site visibility' ) : _e( 'Search engine visibility' ); ?> </th>
   208 <th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site visibility' ) : _e( 'Search engine visibility' ); ?> </th>
   181 <td><fieldset><legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site visibility' ) : _e( 'Search engine visibility' ); ?> </span></legend>
   209 <td><fieldset>
       
   210 	<legend class="screen-reader-text"><span>
       
   211 		<?php
       
   212 		has_action( 'blog_privacy_selector' )
       
   213 			/* translators: Hidden accessibility text. */
       
   214 			? _e( 'Site visibility' )
       
   215 			/* translators: Hidden accessibility text. */
       
   216 			: _e( 'Search engine visibility' );
       
   217 		?>
       
   218 	</span></legend>
   182 <?php if ( has_action( 'blog_privacy_selector' ) ) : ?>
   219 <?php if ( has_action( 'blog_privacy_selector' ) ) : ?>
   183 	<input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( '1', get_option( 'blog_public' ) ); ?> />
   220 	<input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( '1', get_option( 'blog_public' ) ); ?> />
   184 	<label for="blog-public"><?php _e( 'Allow search engines to index this site' ); ?></label><br/>
   221 	<label for="blog-public"><?php _e( 'Allow search engines to index this site' ); ?></label><br />
   185 	<input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> />
   222 	<input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked( '0', get_option( 'blog_public' ) ); ?> />
   186 	<label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label>
   223 	<label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label>
   187 	<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>
   224 	<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>
   188 	<?php
   225 	<?php
   189 	/**
   226 	/**
   190 	 * Enable the legacy 'Site visibility' privacy options.
   227 	 * Enables the legacy 'Site visibility' privacy options.
   191 	 *
   228 	 *
   192 	 * By default the privacy options form displays a single checkbox to 'discourage' search
   229 	 * By default the privacy options form displays a single checkbox to 'discourage' search
   193 	 * engines from indexing the site. Hooking to this action serves a dual purpose:
   230 	 * engines from indexing the site. Hooking to this action serves a dual purpose:
   194 	 *
   231 	 *
   195 	 * 1. Disable the single checkbox in favor of a multiple-choice list of radio buttons.
   232 	 * 1. Disable the single checkbox in favor of a multiple-choice list of radio buttons.