Created
May 5, 2015 19:33
-
-
Save timersys/d3c34d736fd3188f1293 to your computer and use it in GitHub Desktop.
Filter Wordpress popup content
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 | |
/** | |
* IF you want to filter popups content to add custom content | |
* http://wordpress.org/plugins/popups/ | |
**/ | |
add_filter('spu/popup/content', 'add_gf_to_spu', 10, 2); | |
function add_gf_to_spu( $content, $popup){ | |
// Check if the popup is the correct one | |
if( $popup->ID == ID_NUMBER_HERE ){ | |
if ( is_page(THE_PAGE_YOU_WANT) ) { | |
$content .= '[my-shortcode-here]'; | |
} | |
} | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment