Skip to content

Instantly share code, notes, and snippets.

@timersys
Created May 5, 2015 19:33
  • 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/d3c34d736fd3188f1293 to your computer and use it in GitHub Desktop.
Filter Wordpress popup content
<?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