Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sybrew
Last active September 17, 2018 17:33
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/f735501978042a94847503aade130fb4 to your computer and use it in GitHub Desktop.
Save sybrew/f735501978042a94847503aade130fb4 to your computer and use it in GitHub Desktop.
Disables The SEO Framework's SEO on wpForo pages.
<?php
// Don't include the PHP tag.
add_action( 'after_setup_theme', function() {
remove_action( 'init', 'The_SEO_Framework\\_wpforo_fix_page' );
add_action( 'the_seo_framework_init', function() {
if ( ! function_exists( 'wpforo_feature' ) || ! function_exists( 'is_wpforo_page' ) )
return;
if ( ! wpforo_feature( 'seo-meta' ) )
return;
if ( is_wpforo_page() ) {
add_filter( 'the_seo_framework_overwrite_titles', '__return_false' );
add_action( 'the_seo_framework_after_init', function() {
remove_action( 'wp_head', [ the_seo_framework(), 'html_output' ], 1 );
} );
}
}, 0 );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment