Last active
December 20, 2015 23:49
-
-
Save tonykwon/6215404 to your computer and use it in GitHub Desktop.
Disabling Jetpack sharing_display
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
add_action( 'plugins_loaded', 'jetpack_sharedaddy' ); | |
function jetpack_sharedaddy() { | |
if ( class_exists( 'Jetpack' ) && | |
method_exists( 'Jetpack', 'get_active_modules' ) && | |
in_array( 'sharedaddy', Jetpack::get_active_modules() ) ) { | |
/* | |
* we need to control where sharedaddy modules show up | |
*/ | |
remove_filter( 'the_content', 'sharing_display', 19 ); | |
remove_filter( 'the_excerpt', 'sharing_display', 19 ); | |
} | |
} | |
add_filter( 'sharing_show', 'sharing_show', 11, 2 ); | |
function sharing_show( $show, $post ) { | |
global $wp_query; | |
// use WordPress conditionals then return either true or false | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment