Changeset 49992 for trunk/src/wp-includes/deprecated.php
- Timestamp:
- 01/21/2021 01:35:16 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/deprecated.php
r49597 r49992 4136 4136 return is_string( $value ) ? addslashes( $value ) : $value; 4137 4137 } 4138 4139 /** 4140 * Displays a noindex meta tag if required by the blog configuration. 4141 * 4142 * If a blog is marked as not being public then the noindex meta tag will be 4143 * output to tell web robots not to index the page content. Add this to the 4144 * {@see 'wp_head'} action. 4145 * 4146 * Typical usage is as a {@see 'wp_head'} callback: 4147 * 4148 * add_action( 'wp_head', 'noindex' ); 4149 * 4150 * @see wp_no_robots() 4151 * 4152 * @since 2.1.0 4153 * @deprecated 5.7.0 Use wp_robots_noindex() instead on 'wp_robots' filter. 4154 */ 4155 function noindex() { 4156 _deprecated_function( __FUNCTION__, '5.7.0', 'wp_robots_noindex()' ); 4157 4158 // If the blog is not public, tell robots to go away. 4159 if ( '0' == get_option( 'blog_public' ) ) { 4160 wp_no_robots(); 4161 } 4162 } 4163 4164 /** 4165 * Display a noindex meta tag. 4166 * 4167 * Outputs a noindex meta tag that tells web robots not to index the page content. 4168 * Typical usage is as a {@see 'wp_head'} callback. add_action( 'wp_head', 'wp_no_robots' ); 4169 * 4170 * @since 3.3.0 4171 * @since 5.3.0 Echo "noindex,nofollow" if search engine visibility is discouraged. 4172 * @deprecated 5.7.0 Use wp_robots_no_robots() instead on 'wp_robots' filter. 4173 */ 4174 function wp_no_robots() { 4175 _deprecated_function( __FUNCTION__, '5.7.0', 'wp_robots_no_robots()' ); 4176 4177 if ( get_option( 'blog_public' ) ) { 4178 echo "<meta name='robots' content='noindex,follow' />\n"; 4179 return; 4180 } 4181 4182 echo "<meta name='robots' content='noindex,nofollow' />\n"; 4183 } 4184 4185 /** 4186 * Display a noindex,noarchive meta tag and referrer origin-when-cross-origin meta tag. 4187 * 4188 * Outputs a noindex,noarchive meta tag that tells web robots not to index or cache the page content. 4189 * Outputs a referrer origin-when-cross-origin meta tag that tells the browser not to send the full 4190 * url as a referrer to other sites when cross-origin assets are loaded. 4191 * 4192 * Typical usage is as a wp_head callback. add_action( 'wp_head', 'wp_sensitive_page_meta' ); 4193 * 4194 * @since 5.0.1 4195 * @deprecated 5.7.0 Use wp_robots_sensitive_page() instead on 'wp_robots' filter 4196 * and wp_strict_cross_origin_referrer() on 'wp_head' action. 4197 */ 4198 function wp_sensitive_page_meta() { 4199 _deprecated_function( __FUNCTION__, '5.7.0', 'wp_robots_sensitive_page()' ); 4200 4201 ?> 4202 <meta name='robots' content='noindex,noarchive' /> 4203 <?php 4204 wp_strict_cross_origin_referrer(); 4205 }
Note: See TracChangeset
for help on using the changeset viewer.