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 code will be a full working example that will add 1 checkbox field to your checkout page for all levels. Please copy the code that you need. | |
function my_pmprorh_init() | |
{ | |
//don't break if Register Helper is not loaded | |
if(!function_exists("pmprorh_add_registration_field")) | |
{ | |
return false; |
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 this function to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
function pmpro_hide_shipping_fields( $shipping_fields ) { | |
unset( $shipping_fields['bphone'] ); | |
return $shipping_fields; | |
} | |
add_filter( 'pmproship_required_shipping_fields', 'pmpro_hide_shipping_fields' ); |
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( 'init', 'switch_my_pmpro_password_notice' ); | |
function switch_my_pmpro_password_notice() { | |
if ( has_filter( 'pmpro_checkout_after_password', 'pmprosp_pmpro_checkout_after_password' ) ) { | |
remove_filter( 'pmpro_checkout_after_password', 'pmprosp_pmpro_checkout_after_password', 1 ); | |
add_filter( 'pmpro_checkout_after_password', 'my_pmprosp_pmpro_checkout_after_password', 1 ); | |
} | |
} | |
function my_pmprosp_pmpro_checkout_after_password() { |
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_head', function () { | |
if($post->ID == $pmpro_pages['checkout']) | |
{ | |
?> | |
<script> | |
/* JavaScript code here */ | |
window.onload = function() { |
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 | |
/** | |
* Show the user's start date. | |
* Show the user's previously membership start date if they were cancelled, expired or cancelled by an admin. | |
* If none of thhe above is found, the string 'nothing found' will be returned. | |
*/ | |
function my_show_user_startdate(){ | |
if ( is_user_logged_in() && function_exists( 'pmpro_hasMembershipLevel' ) && pmpro_hasMembershipLevel() ){ |
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 translate_pmpro_text( $translated_text, $text, $domain ) | |
{ | |
if($domain == 'paid-memberships-pro') { | |
if($text == 'Membership invoice'){ | |
$translated_text = 'Subscriber Invoice'; | |
} |
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
/* | |
Clear out all PMPro member and report data. (Back up your database first. Use at your own risk!!!) | |
This will delete all orders, members/level data, and reporting data. | |
Your levels, discount codes, and settings will remain in place. | |
All users will remain users (without memberships). | |
All subscriptions at the gateway will remain active. | |
To Use: | |
* Copy this code into your active theme's functions.php or a custom WP plugin. | |
* Navigate to /wp-admin/?pmprocleardata=1 when logged in as an admin. |
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 pmpro_check_username_length( $pmpro_continue_registration ) { | |
//only bother if things are okay so far | |
if(!$pmpro_continue_registration) | |
return $pmpro_continue_registration; | |
$username = $_REQUEST['username']; |
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_pmpro_translate_to_german($translated_text, $original_text, $domain) { | |
switch ( $translated_text ) { | |
case 'Check Out with a Credit Card Here' : | |
$translated_text = __( 'Translation in German Here', 'paid-memberships-pro' ); | |
break; | |
} | |
return $translated_text; |
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 add_taxonomies_to_pages() | |
{ | |
register_taxonomy_for_object_type( 'post_tag', 'page' ); | |
register_taxonomy_for_object_type( 'category', 'page' ); | |
} | |
add_action( 'init', 'add_taxonomies_to_pages' ); |