Created
March 3, 2016 14:38
-
-
Save eighty20results/154f53a25a217e5d2124 to your computer and use it in GitHub Desktop.
Load additional "custom" fields to the advanced settings page.
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 | |
/* | |
Plugin Name: PMPro Custom Admin Page | |
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/ | |
Description: Templated admin pages for Paid Memberships Pro | |
Version: .1 | |
Author: Stranger Studios | |
Author URI: http://www.strangerstudios.com | |
*/ | |
function my_adminpage_setup() { | |
add_submenu_page('pmpro-membershiplevels', __('Advanced Settings', 'pmpro'), __('Advanced Settings', 'pmpro'), 'pmpro_advancedsettings', 'pmpro-advancedsettings', 'my_advancedsettings'); | |
} | |
add_action('admin_menu', 'my_adminpage_setup'); | |
function my_advancedsettings() | |
{ | |
// Assumes there is an '/paid-memberships-pro/adminpages' directory somewhere in | |
// either the active/child theme or the parent theme. | |
if ( file_exists( get_stylesheet_directory() . "/paid-memberships-pro/adminpages/" ) ) | |
$template_path = get_stylesheet_directory() . "/paid-memberships-pro/adminpages/"; | |
elseif ( file_exists( get_template_directory() . "/paid-memberships-pro/adminpages/" ) ) | |
$template_path = get_template_directory() . "/paid-memberships-pro/adminpages/"; | |
elseif ( file_exists( PMPRO_DIR . "/adminpages/" ) ) | |
$template_path = PMPRO_DIR . "/adminpages/"; | |
// Load the Admin page ('advancedsettings.php') | |
require_once( $template_path. "/advancedsettings.php" ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment