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 example for five fields. This is a test Register Helper example. | |
* Please add the below code to your custom plugin or Code Snippets Plugin by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmprorh_init() { | |
//don't break if Register Helper is not loaded | |
if(!function_exists( "pmprorh_add_registration_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 | |
/* | |
Add bcc for checkout emails | |
*/ | |
function my_pmpro_email_headers_admin_emails($headers, $email) { | |
//bcc checkout emails | |
if(strpos($email->template, "checkout_") !== false) { | |
//add bcc | |
$headers[] = "Bcc:" . "otheremail@domain.com"; | |
} |
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 example for a select and text field. | |
* Please add the below code to your custom plugin or Code Snippets Plugin by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmprorh_init() { | |
//don't break if Register Helper is not loaded | |
if(!function_exists( "pmprorh_add_registration_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 | |
/* | |
* Redirect on login if user has any failed payments. (Requires Paid Memberships Pro Failed Payment Limit Add On) | |
* Adjust the code on the line the line "site_url( ' payment-failed')" to redirect to page of your prefereance. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_login_redirect_url( $url, $request, $user ) { | |
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 // do not copy this line, doing so will give you a fatal error when you run this script | |
/* | |
If you are using this code, please be aware of privacy laws in your region and also beware of spambots harvesting your users' | |
emails from your website. | |
*/ | |
function tiquality_add_custom_field() { | |
if ( bp_is_active( 'xprofile' ) ) : |
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 codes requires you to have the sponsored Members Add On up and configured. | |
This code should also be added together with your configured sponsored members code in your PMPro customizations Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
This script is an example that allows level 2 to purchase 5 membership accounts for level 3 but | |
have level 3 individualy pay $20 for their membership accounts. | |
Please see the add on guide for more attributes that can be configured for your sponsored members add on here: https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/ | |
*/ | |
global $pmprosm_sponsored_account_levels; |
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 // do not copy this line | |
add_filter( 'caldera_forms_phone_js_options', function( $options){ | |
//Use ISO_3166-1_alpha-2 formatted country code | |
$options[ 'initialCountry' ] = 'NG'; | |
return $options; | |
}); |
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 // do not copy this line | |
// Copy from below here | |
function my_pmproz_after_checkout_data( $data, $user_id, $level, $order ) { | |
$data['my_usermeta'] = get_user_meta($user_id, 'my_usermeta', true); // add your custom usermeta key in place of my_usermeta | |
return $data; | |
} | |
add_filter( 'pmproz_after_checkout_data', 'my_pmproz_after_checkout_data', 10, 4 ); |
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 | |
/* | |
Sample method to show a level's Member Badge on the three column layout of the | |
Membership Levels page when using the Advanced Levels Page Shortcode Add On. | |
*/ | |
function my_pmproal_before_level_member_badge( $level_id, $layout ) { | |
if( function_exists( 'pmpromb_getBadgeForLevel' ) ) { | |
$image = pmpromb_getBadgeForLevel($level_id); | |
if( ! empty( $image ) && $layout == '3col' ) { | |
echo '<img class="pmpro_member_badge" src="' . esc_url($image) . '" border="0" />'; |
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_filter( 'login_url', 'marypmpro_custom_login_url', 10, 3 ); // marypmpro here is the name of my site | |
/** | |
* Filters the login URL. | |
* | |
* @since 2.8.0 | |
* @since 4.2.0 The `$force_reauth` parameter was added. | |
* |
OlderNewer