Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Adding a custom rule to Wordpress Popups Plugin
* Adding a custom rule to display popup only on
* single posts of certain category
* /
add_filter('spu/rules/rule_match/post_category', 'spu_rule_match_post_category', 12, 2);
function spu_rule_match_post_category($match, $rule){
global $post;
// validate
if( !$post->ID )
return false;
$match = false;
if( is_single() ) {
$match = true;
return $match;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment