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
/** | |
* Retroactively assign a user to a Parent account when using the Sponsored Members Add On. | |
* Enter the user ID of parent account in the "Assign to Parent Account" on the "Edit Profile" screen. | |
* | |
* Note: The user's active Membership Level must be the correct "Child" level for that Parent/Child relationship. | |
* | |
*/ | |
function pmprosm_assign_child_members( $profileuser ) { | |
if ( function_exists( 'pmprosm_getSponsor' ) && current_user_can( 'edit_users' ) ) { |
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 PHP tag into your code. | |
/** | |
* Define groups of levels and allow members to select from both levels at checkout. | |
* Useful for offering multiple pricing structures for membership (i.e. Monthly, Annually) | |
* | |
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
// Define the groups of levels. array(1,2) means that levels 1 and 2 are in a group and options will be shown for both levels at checkout for those levels. | |
global $pmpro_level_groups; |
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 will show '0/X spots available.' on membership level if a limit is set from (https://www.paidmembershipspro.com/limit-number-members-membership-level/) | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* For help, post a support thread on www.paidmembershipspro.com | |
*/ | |
function pmpro_show_spots_available( $expiration_text, $level ) { | |
global $wpdb; |
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 | |
/** | |
* Script to locate, tag, export, then delete inactive users in your Paid Memberships Pro / WordPress website. | |
* | |
* Once this snippet is in the site, admins can run the process by visiting /?delete_inactive_users=1 in the WordPress admin. | |
* Always back up user data before running any bulk delete script and remove this code after the process is done. | |
*/ | |
function my_pmpro_tag_inactive_users() { | |
if ( ! defined( 'PMPRO_VERSION' ) ) { | |
exit; |
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 | |
/** | |
* Display credit card logos before the submit button on the Paid Memberships Pro Membership Checkout page. | |
* | |
* Download the icons from https://www.paidmembershipspro.com/add-credit-card-and-paypal-logos-to-checkout/ | |
* Place the image file in the correct location according to your customizations structure. | |
*/ | |
function pmpro_add_my_logos_to_checkout(){ | |
global $pmpro_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
/* CSS Document */ | |
#pmpro_payment_method span a { | |
background-position: left bottom; | |
background-size: contain; | |
background-repeat: no-repeat; | |
display: inline-block; | |
margin-left: 1%; | |
max-width: 300px; | |
padding-bottom: 60px; | |
text-align: left; |
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 | |
/** | |
* Example of how to add links to the Member Links list on the Membership Account page. | |
* | |
*/ | |
// Add links to the top of the list | |
function my_pmpro_member_links_top() { | |
//Add the level IDs here | |
if ( pmpro_hasMembershipLevel( array(1,2,3 ) ) ) { |
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 | |
/* | |
* Don't show confirm password or email fields on the checkout page. | |
* | |
* 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/ | |
*/ | |
add_filter( 'pmpro_checkout_confirm_password', '__return_false' ); |
NewerOlder