Skip to content

Instantly share code, notes, and snippets.

Avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / set-pmpro-form-element-max-width.css
Created Dec 5, 2022
Set maximum width for PMPro checkout form input form elements. This could be helpful if the required field asterisk appears below the input field due to theme style inheritance.
View set-pmpro-form-element-max-width.css
/*
Set maximum width for PMPro checkout form input form elements.
Lowering the max-width percentage to suit your specific site, e.g. max-width: 85%;
This could be helpful if the required field asterisk appears below the input field
due to theme style inheritance.
*/
@ipokkel
ipokkel / hide-and-remove-cancel-all-memberships-link-from-cancel-page.php
Created Dec 2, 2022
Hide and remove the "Cancel All Memberships" link from the PMPro Cancel page.
View hide-and-remove-cancel-all-memberships-link-from-cancel-page.php
@ipokkel
ipokkel / add-billing-to-add-member-and-profile-user-fields.php
Last active Dec 2, 2022
Create user fields with code to add Paid Memberships Pro Billing Address as required fields to Edit Profile, User Profile Edit (admin), and Add Member from Admin pages. #paid-memberships-pro
View add-billing-to-add-member-and-profile-user-fields.php
<?php
/**
* This will add billing fields to Add Member from Admin and the user profile edit pages.
*
* Optional: Set if fields should be required
*
* Requires Paid Memberships Pro and PMPro Register Helper plugins active.
*
* 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.
@ipokkel
ipokkel / my_pmpro_member_shortcode_custom_field_1669295230000.php
Created Nov 24, 2022
Add custom field for pmpro_member shortcode that display the user's level(s) and their expiration date(s)
View my_pmpro_member_shortcode_custom_field_1669295230000.php
<?php
/**
* This recipe adds the custom field my_memberships to the [pmpro_member] shortcode
* that will display a user's membership level(s) and expiration date(s).
*
* Supports Multiple Memberships Per User (MMPU) Add On to display all the user's membership levels.
*
* Example Usage of [pmpro_member field="my_memberships"]
* Membership Level: Starter
* Membership Expires: Never
@ipokkel
ipokkel / pmpro-send-copy-of-recurring-reminder-to-additional-email.php
Created Nov 22, 2022
BCC a copy of recurring payment reminder emails to an additional email address, e.g. admin.
View pmpro-send-copy-of-recurring-reminder-to-additional-email.php
<?php
/**
* Send a copy of an Invoice email i a member has specified and additional invoice email addresses.
*
* This recipe require an additional email address to be set in usermeta table.
*
* Collecting an additional invoice email address should be achievable with a custom User Field.
* @link https://www.paidmembershipspro.com/documentation/user-fields/
*
* You can add this recipe to your site by creating a custom plugin
@ipokkel
ipokkel / pmpro-member-profile-edit-add-required-attribute.php
Created Nov 21, 2022
Add HTML5 required attribute to fields on the Member Profile Edit page that has the pmpro_required class assigned.
View pmpro-member-profile-edit-add-required-attribute.php
<?php
/**
* Add HTML5 attribute required to all required PMPro fields on the front end
* PMPro Member Profile Edit 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/
*/
@ipokkel
ipokkel / pmpro-disable-invoice-email-per-level.php
Created Nov 18, 2022
Disable PMPro Invoice emails per level.
View pmpro-disable-invoice-email-per-level.php
<?php
/**
* Disable the PMPro invoice email for specified levels.
*
* 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-bcc-invoice-emails.php
Last active Nov 17, 2022
Send a copy of invoice email to an additional email address if the member has set an addtional email address.
View pmpro-bcc-invoice-emails.php
<?php
/**
* Send a copy of an Invoice email i a member has specified and additional invoice email addresses.
*
* This recipe require an additional email address to be set in usermeta table.
*
* Collecting an additional invoice email address should be achievable with a custom User Field.
* @link https://www.paidmembershipspro.com/documentation/user-fields/
*
* You can add this recipe to your site by creating a custom plugin
@ipokkel
ipokkel / pmpro-currencies-add-us-before-dollar-sign.php
Created Nov 17, 2022
Change "$" to "US$" for the PMPro US Dollar currency symbol.
View pmpro-currencies-add-us-before-dollar-sign.php
<?php
/**
* Add "US" as a prefix to "$" for the US Dollar currency code ("US$").
*
* 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/
*/
View trim-member-profile-fields-array-values.php
<?php
/**
* Trim the custom user meta field in the array of fields to display
* on the PMPro Member Directory pages.
*
* This helps remove spaces erroneously added to the list of fields
* to display on the PMPro Member Directory pages.
*
* 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.