Skip to content

Commit

Permalink
Protect: introduce new wp_robots_no_robots when available
Browse files Browse the repository at this point in the history
wp_robots_no_robots() replaces wp_no_robots() in WP 5.7:
https://core.trac.wordpress.org/ticket/51511#comment:13
  • Loading branch information
jeherve committed Feb 22, 2021
1 parent 8193af7 commit d4fef95
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,11 @@ function display_page( $title, $message, $back_button = false, $recovery_form =
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width">
<?php
if ( function_exists( 'wp_no_robots' ) ) {
// Remove wp_no_robots() when WordPress 5.7 is the minimum required version.
if ( function_exists( 'wp_robots' ) && function_exists( 'wp_robots_no_robots' ) && function_exists( 'add_filter' ) ) {
add_filter( 'wp_robots', 'wp_robots_no_robots' );
wp_robots();
} else {
wp_no_robots();
}
?>
Expand Down

0 comments on commit d4fef95

Please sign in to comment.