Skip to content

Instantly share code, notes, and snippets.

Avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / my-pmpro-remove-non-default-countries.php
Last active Jul 27, 2021
Remove all countries except the default PMPro country.
View my-pmpro-remove-non-default-countries.php
<?php
/**
* This recipe is an example of how to keep only the PMPro default country
* and remove all other countries from the "Country" dropdown select.
*
* The PMPro default country is "US" (United States), to set
* your custom default country, please refer to this article.
* @link https://www.paidmembershipspro.com/change-the-default-country-of-your-membership-website/
*
* For available countries and their shortcode see:
@ipokkel
ipokkel / custom-level-confirmation-message-for-pmpro-approvals.php
Created Jul 22, 2021
Keep the custom messages set for each level under Membership >> Membership Levels and combine it with the PMPro Approvals status.
View custom-level-confirmation-message-for-pmpro-approvals.php
<?php
/**
* Create a custom confirmation for Approvals Add On.
*
* 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/
*/
@ipokkel
ipokkel / show-login-register-links-on-member-pages.php
Created Jul 14, 2021
Show a login/register link at the bottom of any post that uses the membership shortcode or the Require Membership Block.
View show-login-register-links-on-member-pages.php
@ipokkel
ipokkel / my-pmpro-email-body-swop-current-user-display-name.php
Created Jul 13, 2021
Example of swapping a display name in the PMPro emai body.
View my-pmpro-email-body-swop-current-user-display-name.php
<?php
/**
* This recipe replaces the current user's display name in an email
* with the recipient's display name.
*
* This is an example of replacing text in the email body that may
* be handy when admin is the current user that trigges a custom mail/template from
* the administrative area and the administrator's name appeared in places in the
* email due to missing variables passed to the email class from a custom email/template.
*
@ipokkel
ipokkel / my-pmpromd-redirect-to-buddypress-profile-page.php
Last active Jul 14, 2021
Redirect to the BuddyPress profile page of a user when a visitor clicks on the "View Profile" link in the PMPro Members Directory page.
View my-pmpromd-redirect-to-buddypress-profile-page.php
<?php
/**
* This recipe changes the PMPro Member Directory's "View Profile"
* link on the directory page to the BuddyPress member directory and
* redirects to the BuddyPress Profile page of the member if the
* URL parameter "pu" is present in the querystring.
*
* 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.
@ipokkel
ipokkel / my-pmpro-checkout-before-form-html-example.php
Created Jul 6, 2021
Display HTML above the PMPro checkout form based on the user's membership level.
View my-pmpro-checkout-before-form-html-example.php
<?php
/**
* This recipe displays HTML above the checkout form based on the user's membership level.
*
* 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/
*/
@ipokkel
ipokkel / my-pmprorh-init-checkbox-grouped-example.php
Created Jul 5, 2021
Example checkbox grouped field for PMPro Regiser Helper.
View my-pmprorh-init-checkbox-grouped-example.php
<?php
/**
* This recipe creates custom fields for membership registration.
*
* @requires Register Helper Add On
* @link https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/
*
* 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.
@ipokkel
ipokkel / my-pmpro-affiliate-code-shortcode.php
Created Jun 30, 2021
Example shortcode to return a user's affiliate code.
View my-pmpro-affiliate-code-shortcode.php
<?php
/**
* This recipe will return a user's affiliate code.
*
* 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/
*/
@ipokkel
ipokkel / redirect-usersa-to-referrer-page-after-logout-wordpress.php
Created Jun 22, 2021
Redirect users to the last page they visited before logout.
View redirect-usersa-to-referrer-page-after-logout-wordpress.php
<?php
/**
* This recipe redirects users to the referring page after logging out of WordPress.
*
* 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/
*/
@ipokkel
ipokkel / pmpro-change-text-example-gettext.php
Created Jun 21, 2021
Example of how to change a text string using the gettext hook.
View pmpro-change-text-example-gettext.php
<?php
/**
* This recipe is an example of how to change and translate localized text strings
* for PMPro.
*
* 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/
*/