Skip to content

Instantly share code, notes, and snippets.

View ipokkel's full-sized avatar

Theuns Coetzee ipokkel

View GitHub Profile
<?php
/**
* Add a reply-to address to PMPro email headers.
*
* 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 add_reply_to_pmpro_email_headers( $headers, $email ) {
<?php
/**
* Remove countries from the countries list.
*
* For country codes you may refer to the countries.php file.
* @link https://github.com/strangerstudios/paid-memberships-pro/blob/dev/includes/countries.php
*
* 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.
<?php
/**
* Add donation email vairable and reset membership cost value to exclude donation.
*
* 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_data_membership_cost_donation( $data, $email ) {
@ipokkel
ipokkel / make-billing-fields-optional.php
Last active January 22, 2025 17:36
Allow users to make the billing fields optional for the PMPro checkout page when they check a checkbox.
<?php
/**
* Make billing fields optional at checkout
*
* 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/
*/
<?php
/**
* Add an "Approval Status" column to the Membership History report.
*
* 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 add_approval_status_column_header() {
<?php
/**
* Stop checkout if the user has a pending membership approval.
*
* 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_stop_checkout_if_not_approved( $continue_registration ) {
@ipokkel
ipokkel / member-directory-hide-label-and-display-field-value-only.php
Created November 19, 2024 14:06
Hide a field's label on the Member Directory and Profile Pages and display only the field's value.
<?php
/**
* Hide the label and display the field value only in the PMPro Member Directory.
*
* 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_pmpromd_hide_label_css( $value, $original_value, $field_name ) {
<?php
/**
* Change the default text for the reason for cancelling field in the PMPro cancel 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_gettext_pmpro_reason_for_cancelling( $translated_text, $text, $domain ) {
@ipokkel
ipokkel / admin-resend-custom-welcome-emails.php
Created November 18, 2024 08:00
Resend a custom welcome message to all existing users on a WordPress site.
<?php
/**
* Resend welcome emails to all users with a custom message.
*
* 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_admin_resend_custom_welcome_emails() {