Skip to content

Instantly share code, notes, and snippets.

@timersys
Created September 11, 2014 22:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save timersys/4b3da498f95bdf18ad8d to your computer and use it in GitHub Desktop.
Adding a custom rule to Wordpress Popups Plugin
/* http://wordpress.org/plugins/popups/
* 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