Created
June 29, 2025 05:11
-
-
Save sybrew/0d426fc1eba277ce21852faf0ae19780 to your computer and use it in GitHub Desktop.
Disable TSF on page ID 12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Do not include the opening PHP tag if PHP is already opened. | |
\add_filter( | |
'the_seo_framework_query_supports_seo', | |
/** | |
* Disables SEO support for page ID 12. | |
* | |
* @param bool $supported Whether the query supports SEO. | |
* @return bool | |
*/ | |
function ( $supported ) { | |
// No need to process if the query already isn't supported. | |
if ( ! $supported ) | |
return $supported; | |
$tsf_query = tsf()->query(); | |
if ( $tsf_query->is_singular() && 12 === $tsf_query->get_the_real_id() ) | |
$supported = false; | |
return $supported; | |
}, | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment