Skip to content

Instantly share code, notes, and snippets.

@messica
Created May 20, 2014 20:51
Show Gist options
  • Save messica/2473fc7a2e73f6431a73 to your computer and use it in GitHub Desktop.
Save messica/2473fc7a2e73f6431a73 to your computer and use it in GitHub Desktop.
Create [my_pmpro_levels] shortcode which will work in sidebar widgets, etc.
<?php
/* Create [my_pmpro_levels] shortcode which will work in sidebar widgets, etc. */
function my_pmpro_levels($atts = NULL)
{
ob_start();
include(PMPRO_DIR . "/preheaders/levels.php");
if(file_exists(get_stylesheet_directory() . "/paid-memberships-pro/pages/levels.php"))
include(get_stylesheet_directory() . "/paid-memberships-pro/pages/levels.php");
else
include(PMPRO_DIR . "/pages/levels.php");
$temp_content = ob_get_contents();
ob_end_clean();
return apply_filters("pmpro_pages_shortcode_levels", $temp_content);
}
add_shortcode('my_pmpro_levels', 'my_pmpro_levels');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment