Skip to content

Instantly share code, notes, and snippets.

@sybrew
Created August 21, 2019 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sybrew/03dd428deadc860309879e1d5208e1c4 to your computer and use it in GitHub Desktop.
Save sybrew/03dd428deadc860309879e1d5208e1c4 to your computer and use it in GitHub Desktop.
Remove SEO Bar items for The SEO Framework.
<?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