Skip to content

Instantly share code, notes, and snippets.

View ipokkel's full-sized avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / show_member_number_on_card.php
Last active September 26, 2023 05:51
Show a member number on the membrship card for Paid Membership Pro.
View show_member_number_on_card.php
<?php
/**
* Show a member number on the membership card for Paid Memberships Pro.
*
* This requires the following:
* @link https://www.paidmembershipspro.com/generate-a-unique-member-number-for-display-on-membership-account-confirmation-email-and-more/
*
* 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 / pmpro-memberslist-text-change.php
Created September 25, 2023 10:54
Change or translate text strings on the administrative PMPro Members List page.
View pmpro-memberslist-text-change.php
<?php
/**
* Change or translate text for the Members List 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_memberslist_text_change( $translated_text, $original_text, $domain ) {
@ipokkel
ipokkel / wp-custom-admin-locale.php
Last active September 25, 2023 10:25
Set the language for the WordPress administrative language.
View wp-custom-admin-locale.php
<?php
/**
* Set the locale to en_US for the WP admin area.
*
* @link https://wordpress.stackexchange.com/questions/27056/different-language-for-frontend-vs-backend
* @link https://developer.wordpress.org/reference/hooks/locale/
*
* 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.
View pmpro-memberslist-renewal-date-column.php
<?php
/**
* This recipe will display the renewal date on the Members page.
*
* This recipe is intended to be used with Stripe or PayPal Express.
* This recipe requires PMPro v2.7.0 or higher.
*
* Notes:
* - If a date is returned, we know it's a recurring membership
* - If "--" is returned, then that specific order is either cancelled or has been renewed (check for a newer order)
@ipokkel
ipokkel / pmpro-approvals-bcc-admin-emails-to-users-with-pmpro-approvals-capability.php
Created September 21, 2023 05:58
Send a copy of PMPro Approval admin notification emails to users that have the pmpro_approvals capability. This should include users that has the pmpro_approver role or the pmpro_membership_manager role role.
View pmpro-approvals-bcc-admin-emails-to-users-with-pmpro-approvals-capability.php
<?php
/**
* Bcc admin approval emails to users with pmpro_approvals capability.
*
* 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 pmpro_approvals_bcc_admin_notification_emails( $headers, $email ) {
View pmpro-remove-register-link-on-login-form.php
View pmpro-show-register-link-on-login-form.php
View pmpro-bcc-admin-approval-emails.php
<?php
/**
* Bcc admin approval emails.
*
* 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_email_headers_bcc_admin_approval_emails( $headers, $email ) {
View pmpro-remove-level-id-from-non-member-messages.php
<?php
/**
* Remove level from non-member messages by level ID.
*
* This will remove the level from the not_logged_in and non-member message strings.
* This is useful if you have a level that you don't want to show in the non-member messages.
*
* 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.
View pmpro-remove-level-name-from-non-member-messages.php
<?php
/**
* Remove level name from non-member messages.
*
* This will remove the level name from the not_logged_in and non-member message strings.
* This is useful if you have a level that you don't want to show in the non-member messages.
*
* 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.