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 a level dropdown at the top and bottom of the users table view than add support to bulk | |
* add level memberships to users. Use at your own risk. Users can expect timeouts and rate limiting often | |
* when bulk editing even a relatively small number of members depending on their hosting and how things are wired up. | |
* link: TBD | |
* | |
* 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. |
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 | |
/** | |
* Make Members table list first name and last name columns sortable | |
* | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_members_list_sql( $sqlQuery ) { | |
global $wpdb; | |
// Bail if the query is not for ordering by last name or first name. Check request |
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 | |
/** | |
* Check if required tables exist and create them if they don't. | |
* This function is used to catch up missing tables that should have been created by Paid Memberships Pro when update to v3 | |
* | |
* link: TBD | |
* | |
* 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. |
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 | |
/** | |
* replace texts with gettext filter | |
* | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_translate_text( $translated_text, $untranslated_text, $domain) { | |
//if the domain dosn't contains pmpro return the original text | |
if( $domain !== 'paid-memberships-pro' && $domain !== 'pmpro-group-accounts') { |
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 | |
/** | |
* Generate a custom member list query by filtering the original SQL Query and modifying as needed | |
* | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function custom_filtered_pmpro_members_list_sql( $sqlQuery ) { |
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 | |
/** | |
* 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. | |
* This gist assume user being edited has an active membership and it's a sponsored level. | |
* | |
* Note: The user's active Membership Level must be the correct "Child" level for that Parent/Child relationship. | |
* | |
*/ | |
function pmprosm_assign_child_members( $profileuser ) { |
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
$( '#pmprogroupacct_child_level_ids' ).select2({ | |
templateSelection: function( option ) { | |
// Customize the display label of each selected option | |
if ( option.text === 'Option 1' ) { | |
return 'Custom Label 1'; | |
} else if ( option.text === 'Option 2' ) { | |
return 'Custom Label 2'; | |
} else if ( option.text === 'Option 3' ) { | |
return 'Custom Label 3'; | |
} else { |
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 to redirect member to their membership level's homepage when | |
* trying to access your site's front page (static page or posts 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/ |
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 | |
/** | |
* | |
* Custom recipe to hide user fields at checkout | |
* | |
* link: TBD | |
* | |
* 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. |
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 | |
/** | |
* | |
* Custom function to add a late fee to the checkout page in Paid Memberships Pro | |
* | |
* link: TBD | |
* | |
* 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. |