Hello!
Please do not use class_exists()
without setting the second parameter to false
. It will crash when the class structure changes because it invokes autoloaders. See https://www.php.net/manual/en/function.class-exists.php.
I recommend using function_exists( 'tsf' )
instead.
But, more specifically, I never made the class you mentioned public. If you look closely at that file, it’ll say “@access private” at the top — this is PHPDoc for “do not document this to the public; it’s for internal use only.” I’ve accidentally marked it as a replacement for The_SEO_Framework\Interpreters\SEOBar
.
But that class was marked “protected” already (same as “private,” but a public API elsewhere exists). The old method tsf()->get_generated_seo_bar()
, which is a gateway to that protected class, was deprecated with no alternatives available.
I deprecated it because I did not expect anyone to output the SEO Bar outside of TSF’s interface. Moreover, consistently loading all styles and scripts for it is complex, and its query API may run into issues.
There’s currently no good way to output the SEO Bar programmatically. You could use \The_SEO_Framework\Admin\SEOBar\Builder::generate_bar( $args )
, but that may cause autoloader issues in the future.
Is there any reason you need to output the SEO Bar? Would it be something I could integrate natively, or where you could benefit from API changes? Let me know, and I’ll see what I can do to make the API future-proof.
As for the is_supported()
part, tsf()->post_type()
is a pool method and doesn’t accept parameters. Instead, please use tsf()->post_type()->is_supported( $post_type );
.