WordPress Quick Tip: Popup Maker Shortcode Button on Custom Post Type

By default the Popup Maker shortcode insertion button only has full functionality on Posts and Pages. Here’s the filter to add full functionality to custom post types. Put it in your theme’s functions file.

/* Add full Popup Maker shortcode functionality to ustom post types */
function theme_name_product_pum_shortcode($pum_post_types) { 
  $pum_post_types[] = 'product'; // this is the WooCommerce Product post type 
  /* 
    If you want to add to multiple, 
    just add more lines like the above, 
    using the appropriate post type names. 
	
    If you need to add to a lot of post types, 
    you could make an array, and use array_merge.
		
      Example: 
        $my_custom_post_types = array('book','author' [.... a bunch of other CPTs ...]);
        $pum_post_types = array_merge($pum_post_types, $my_custom_post_types);
  */ 
  return $pum_post_types; 
} 
add_filter('pum_shortcode_post_types', 'theme_name_product_pum_shortcode');