Created
August 21, 2019 04:58
-
-
Save sybrew/03dd428deadc860309879e1d5208e1c4 to your computer and use it in GitHub Desktop.
Remove SEO Bar items for The SEO Framework.
This file contains 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 | |
// Example! | |
/** | |
* Adjust SEO Bar interpreter and builder items here. | |
* | |
* The only use we can think of here is removing items from `$builder::$tests`, | |
* and reading `$interpreter::$query`. Do not add tests here. Do not alter the query. | |
* | |
* @since 4.0.0 | |
* @param string $interpreter The interpreter class name. | |
* @param \The_SEO_Framework\Bridges\SeoBar $builder The builder object. | |
*/ | |
add_action( 'the_seo_framework_prepare_seo_bar', function( $interpreter, $builder ) { | |
// Read the current query. Contains 'id', 'taxonomy', and 'post_type' entries. | |
$query = $interpreter::$query; | |
// Prevent the 'redirect' test from occuring. | |
$builder::$tests = array_diff( | |
$builder::$tests, | |
[ 'redirect' ] | |
); | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment