Adding a custom rule to Wordpress Popups Plugin
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
/* 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