Created
November 22, 2020 22:48
-
-
Save michaelbourne/690cd18649fab652924dc0d83ee65503 to your computer and use it in GitHub Desktop.
Disable Yoast's enhanced Slack sharing on pages and CPTs (non-posts)
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 | |
// functions.php in a child theme | |
/** | |
* Disable Yoast's Enahnced Slack Sharing feature on non-posts | |
*/ | |
function mb_disable_slack_enhancements() { | |
if ( 'post' !== get_post_type() ) { | |
add_filter( 'wpseo_output_enhanced_slack_data', '__return_false' ); | |
} | |
} | |
add_action( 'wp', 'mb_disable_slack_enhancements' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment