Skip to content

Instantly share code, notes, and snippets.

@pbrocks
Last active February 7, 2017 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbrocks/bbde547c1cafbbe7f1a54ffef1681022 to your computer and use it in GitHub Desktop.
Save pbrocks/bbde547c1cafbbe7f1a54ffef1681022 to your computer and use it in GitHub Desktop.
Attempt to remove and replace custom email templates for PMPro
/**
* Drop into PMPro Customizations file /pmpro-customizations/pmpro-customizations.php
* Copy emailtemplates.php from /pmpro-email-templates/adminpages/ to /pmpro-customizations/
*/
add_action( 'admin_init', 'remove_original_admin_menu', 0 );
function remove_original_admin_menu() {
remove_submenu_page( 'pmpro-membershiplevels', 'pmpro-email-templates' );
}
add_action( 'admin_menu', 'pmproet_admin_menu_revised' );
function pmproet_admin_menu_revised() {
add_submenu_page( 'pmpro-membershiplevels', __( 'Custom Email Templates', 'pmproet'), __( 'Custom Email Templates', 'pmproet'), 'manage_options', 'pmpro-custom-email-templates', 'pmproet_admin_page_revised' );
}
function pmproet_admin_page_revised() {
global $submenu;
require_once( 'email-templates.php' ); // I renamed to keep files distinct
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment