Last active
February 12, 2018 03:30
-
-
Save clreed87/afd7c7d10169e78fcecda1548f321327 to your computer and use it in GitHub Desktop.
Do not trigger Jetpack Publicize if the post uses the 'status' post format
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 | |
// Do not include the opening php tag. | |
//* Do not trigger Jetpack Publicize if the post uses the 'status' post format. | |
add_filter( 'publicize_should_publicize_published_post', 'crt_control_publicize', 10, 2 ); | |
function crt_control_publicize( $should_publicize, $post ) { | |
// Return early if we don't have a post yet (it hasn't been saved as a draft) | |
if ( ! $post ) { | |
return $should_publicize; | |
} | |
// Return false is the format is 'status' | |
if ( has_post_format( 'status', $post->ID ) ) { | |
return false; | |
} | |
return $should_publicize; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment