Created
May 20, 2014 20:51
-
-
Save messica/2473fc7a2e73f6431a73 to your computer and use it in GitHub Desktop.
Create [my_pmpro_levels] shortcode which will work in sidebar widgets, etc.
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 | |
/* 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