Skip to content

Commit 82a7f70

Browse files
committed
Fix deprecation break for wp_no_robots()
1 parent 5efcfd4 commit 82a7f70

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

includes/class-wp-job-manager-post-types.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct() {
6060

6161
add_action( 'transition_post_status', [ $this, 'transition_post_status' ], 10, 3 );
6262

63-
add_action( 'wp_head', [ $this, 'noindex_expired_filled_job_listings' ] );
63+
add_action( 'wp_head', [ $this, 'noindex_expired_filled_job_listings' ], 0 );
6464
add_action( 'wp_footer', [ $this, 'output_structured_data' ] );
6565
add_filter( 'wp_sitemaps_posts_query_args', [ $this, 'sitemaps_maybe_hide_filled' ], 10, 2 );
6666

@@ -1379,7 +1379,11 @@ public function noindex_expired_filled_job_listings() {
13791379
return;
13801380
}
13811381

1382-
wp_no_robots();
1382+
if ( function_exists( 'wp_robots_no_robots' ) ) {
1383+
add_filter( 'wp_robots', 'wp_robots_no_robots' );
1384+
} else {
1385+
wp_no_robots();
1386+
}
13831387
}
13841388

13851389
/**

0 commit comments

Comments
 (0)