This file contains hidden or 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
/* Main layout: arrange all my address fields in 2 columns */ | |
#pmpro_form_fieldset-my-address .pmpro_form_fields { | |
display: flex !important; | |
flex-wrap: wrap !important; | |
flex-direction: row !important; | |
gap: 20px; | |
} | |
/* Each field gets half-width column */ | |
#pmpro_form_fieldset-my-address .pmpro_form_field { |
This file contains hidden or 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_set_default_vat_country_on_checkout() { | |
// Only run on checkout page if a country isn't already set. | |
if ( ! function_exists( 'pmpro_is_checkout' ) || ! pmpro_is_checkout() || ! empty( $_REQUEST['eucountry'] ) || ! empty( $_SESSION['eucountry'] ) ) { | |
return; | |
} | |
// Get the default country and the EU countries. | |
$default_country = apply_filters( 'pmpro_default_country', '' ); | |
global $pmpro_european_union; |
This file contains hidden or 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 adds the custom field all_memberships_names for the [pmpro_member] shortcode | |
* that will display a comma separated list of all the user's membership level(s). | |
* | |
* Example Usage of [pmpro_member field="all_memberships_names"] | |
* | |
* 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 hidden or 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
/* change select button colors for level 3 for non level 3 members */ | |
body.pmpro-levels:not(.pmpro-body-has-level-3) #pmpro_level-3 .pmpro_level-select .pmpro_btn.pmpro_btn-select{ | |
background-color: rgb(0, 165, 157); | |
border-color: rgb(0, 165, 157); | |
} | |
body.pmpro-levels:not(.pmpro-body-has-level-3) #pmpro_level-3 .pmpro_level-select .pmpro_btn.pmpro_btn-select:hover { | |
background-color: rgb(0, 200, 190); | |
border-color: rgb(0, 200, 190); | |
} |
This file contains hidden or 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 directory search form, company and company role */ | |
body:not(.pmpro-body-has-level-2):not(.pmpro-body-has-level-3) form.pmpro_member_directory_search, | |
body:not(.pmpro-body-has-level-2):not(.pmpro-body-has-level-3) .pmpro_member_directory .pmpro_card .pmpro_member_profile_field-company, | |
body:not(.pmpro-body-has-level-2):not(.pmpro-body-has-level-3) .pmpro_member_directory .pmpro_card .pmpro_member_profile_field-company_role { | |
display: none; | |
} | |
/* show directory search form for level 2 and 3 members */ | |
body.pmpro-body-has-level-2 form.pmpro_member_directory_search, | |
body.pmpro-body-has-level-3 form.pmpro_member_directory_search { |
This file contains hidden or 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 | |
/** | |
* Cancel membership level and subscription at payment gateway when a member is denied. | |
* | |
* 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_cancel_subscription_on_denial( $user_id, $level_id ) { |
This file contains hidden or 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 old members to the membership account page on login. | |
* | |
* 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_login_redirect_old_members_to_membership_account( $redirect_to, $request, $user ) { |
This file contains hidden or 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 | |
/** | |
* Flush WordPress user meta cache. | |
* | |
* Add the flushmetacache parameter to the admin URL to flush the user meta cache. | |
* e.g., http://your-site.com/wp-admin/admin.php?flushmetacache=1 | |
* | |
* 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 hidden or 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 | |
/** | |
* Change the "Choose a membership level" wording on the Paid Memberships Pro account 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/ | |
*/ | |
function my_pmpro_account_page_gettext_changes( $translated, $text, $domain ) { | |
global $pmpro_pages; |
This file contains hidden or 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 | |
/** | |
* Helper function to get the parent ID of a group account for a given user. | |
* | |
* 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_pmprogroupacct_get_group_parent_id( $user_id ) { |
NewerOlder