Changeset 49992 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 01/21/2021 01:35:16 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r49977 r49992 3192 3192 3193 3193 /** 3194 * Displays a noindex meta tag if required by the blog configuration. 3195 * 3196 * If a blog is marked as not being public then the noindex meta tag will be 3197 * output to tell web robots not to index the page content. Add this to the 3198 * {@see 'wp_head'} action. 3199 * 3200 * Typical usage is as a {@see 'wp_head'} callback: 3201 * 3202 * add_action( 'wp_head', 'noindex' ); 3203 * 3204 * @see wp_no_robots() 3205 * 3206 * @since 2.1.0 3207 */ 3208 function noindex() { 3209 // If the blog is not public, tell robots to go away. 3210 if ( '0' == get_option( 'blog_public' ) ) { 3211 wp_no_robots(); 3212 } 3213 } 3214 3215 /** 3216 * Display a noindex meta tag. 3217 * 3218 * Outputs a noindex meta tag that tells web robots not to index the page content. 3219 * Typical usage is as a {@see 'wp_head'} callback. add_action( 'wp_head', 'wp_no_robots' ); 3220 * 3221 * @since 3.3.0 3222 * @since 5.3.0 Echo "noindex,nofollow" if search engine visibility is discouraged. 3223 */ 3224 function wp_no_robots() { 3225 if ( get_option( 'blog_public' ) ) { 3226 echo "<meta name='robots' content='noindex,follow' />\n"; 3227 return; 3228 } 3229 3230 echo "<meta name='robots' content='noindex,nofollow' />\n"; 3231 } 3232 3233 /** 3234 * Display a noindex,noarchive meta tag and referrer origin-when-cross-origin meta tag. 3235 * 3236 * Outputs a noindex,noarchive meta tag that tells web robots not to index or cache the page content. 3194 * Displays a referrer strict-origin-when-cross-origin meta tag. 3195 * 3237 3196 * Outputs a referrer origin-when-cross-origin meta tag that tells the browser not to send the full 3238 3197 * url as a referrer to other sites when cross-origin assets are loaded. 3239 3198 * 3240 * Typical usage is as a wp_head callback. add_action( 'wp_head', 'wp_s ensitive_page_meta' );3241 * 3242 * @since 5. 0.13243 */ 3244 function wp_s ensitive_page_meta() {3199 * Typical usage is as a wp_head callback. add_action( 'wp_head', 'wp_strict_cross_origin_referrer' ); 3200 * 3201 * @since 5.7.0 3202 */ 3203 function wp_strict_cross_origin_referrer() { 3245 3204 ?> 3246 <meta name='robots' content='noindex,noarchive' />3247 3205 <meta name='referrer' content='strict-origin-when-cross-origin' /> 3248 3206 <?php
Note: See TracChangeset
for help on using the changeset viewer.