Created
December 20, 2020 14:11
-
-
Save Alimir/93c3fd9d5a184cbe25f5a18ea8100fdd to your computer and use it in GitHub Desktop.
wp ulike filter content auto display by category
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 | |
function wp_ulike_custom_content_filter( $button, $content ){ | |
if ( in_the_loop() && is_main_query() && is_singular() && has_category( array('uncategorized') ) ){ | |
return $button; | |
} | |
return $content; | |
} | |
add_filter( 'wp_ulike_the_content', 'wp_ulike_custom_content_filter', 2, 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment