Last active
September 17, 2018 17:33
-
-
Save sybrew/f735501978042a94847503aade130fb4 to your computer and use it in GitHub Desktop.
Disables The SEO Framework's SEO on wpForo pages.
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 | |
// 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