Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('wp_head', function() {
- ob_start();
- }, 0);
- add_action('wp_head', function() {
- $siteHeaderOutput = ob_get_clean();
- // just a variable that i'll be using in a transient
- $siteHasNoIndex = "not set";
- if (strpos($siteHeaderOutput, 'noindex') !== false) {
- $siteHasNoIndex = "no index";
- } else {
- $siteHasNoIndex = "index ready";
- }
- // echo the header
- echo $siteHasNoIndex;
- // then set a transient for the admin panel
- set_transient('escode_has_index', $siteHasNoIndex, DAY_IN_SECONDS);
- }, PHP_INT_MAX);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement