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 | |
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); | |
function my_theme_enqueue_styles() { | |
$parent_style = 'parent-style'; | |
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); | |
wp_enqueue_style( 'child-style', | |
get_stylesheet_directory_uri() . '/style.css', | |
array( $parent_style ), |
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 | |
function change_text_for_pmpro_renewal( $text, $level ) { | |
// check if user is logged in else bail. | |
if( !is_user_logged_in() ) { | |
return $text; | |
} | |
global $current_user; | |
$membership = $current_user->membership_level; |
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 | |
/* | |
Hide billing address fields and make them optional. | |
*/ | |
//css to hide the fields | |
function wp_head_hide_billing_fields() | |
{ | |
global $post, $pmpro_pages; | |
if(empty($pmpro_pages) || (!is_page($pmpro_pages['checkout']) && !is_page($pmpro_pages['billing']))) | |
return; |
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 | |
function my_pmprorh_init() | |
{ | |
//don't break if Register Helper is not loaded | |
if(!function_exists( 'pmprorh_add_registration_field' )) { | |
return false; | |
} | |
$fields = array(); | |
$fields[] = new PMProRH_Field( |
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 | |
//record when users gain the trial level | |
function my_pmpro_after_change_membership_level($level_id, $user_id) | |
{ | |
global $trial_level_ids; | |
if(in_array($level_id, $trial_level_ids)) | |
{ | |
//add user meta to record the fact that this user has had this level before | |
update_user_meta($user_id, "pmpro_trial_level_used", "1"); |
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 | |
// REGISTER HELPER | |
function my_pmprorh_init() | |
{ | |
//don't break if Register Helper is not loaded | |
if(!function_exists( 'pmprorh_add_registration_field' )) { | |
return false; | |
} | |
$fields = array(); |
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 | |
/* | |
Disable the "Admin Checkout" emails in Paid Memberships Pro | |
*/ | |
function my_pmpro_email_recipient($recipient, $email) | |
{ | |
$user = get_user_by( $email, $recipient ); | |
$user_level = pmpro_getMembershipLevelForUser( $user ); | |
if(($email->template == "checkout_paid_admin" || $email->template == "checkout_free_admin") && ($user_level->ID == '4')) //could check for a different template here | |
$recipient = NULL; |
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
/* | |
Hide billing address fields and make them optional. | |
Meant to be used with the Braintree Payments gateway. | |
*/ | |
//css to hide the fields | |
function wp_head_hide_billing_fields() | |
{ | |
global $post, $pmpro_pages; | |
if(empty($pmpro_pages) || (!is_page($pmpro_pages['checkout']) && !is_page($pmpro_pages['billing']))) | |
return; |
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 | |
/** | |
* This recipe will forward the Membership Expiring email to another email address | |
* | |
* You can add this recipe to your site by creating a custom plugin | |
* or using the Code Snippets plugin available for free in the WordPress repository. | |
* Read this companion article for step-by-step directions on either method. | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_email_recipient($headers, $email) { |
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 | |
/* | |
Disable the "Membership Recurring" emails in Paid Memberships Pro | |
*/ | |
function my_pmpro_email_recipient($recipient, $email) | |
{ | |
$user = get_user_by( $email, $recipient ); | |
$user_level = pmpro_getMembershipLevelForUser( $user ); | |
OlderNewer