Skip to content

Instantly share code, notes, and snippets.

View ipokkel's full-sized avatar

Theuns Coetzee ipokkel

View GitHub Profile
<?php
/**
* Modify user field attributes example code.
* For Example: Change profile attribute based on location and user role.
*
* 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
/**
* Change the gettext strings on the PMPro member profile edit and checkout 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.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function gettext_pmpro_profile_checkout_pages( $translated_text, $text, $domain ) {
<?php
/**
* Set the site email address for PMPro 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_data_siteemail( $data, $email ) {
<?php
/**
* Replace email variables with data in PMPro 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_replace_email_variables_with_data( $email ) {
@ipokkel
ipokkel / add-invoice-email-variables.php
Created May 20, 2024 18:40
Add Invoice ID, Date, Total, and URL email variables to PMPro emails if they have a membership ID.
<?php
/**
* Add invoice_id, invoice_date, and invoice_total to PMPro email data.
*
* 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_add_invoice_email_variables( $data, $email ) {
<?php
/**
* Example code recipe to add a checkbox grouped user field.
*
* 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_example_checkbox_grouped_user_field() {
@ipokkel
ipokkel / pmpro-set-admin-email-extra-fields.php
Created May 13, 2024 09:51
Set which user fields are added as "Extra Fields" to the admin checkout confirmation email. Fields not specified will be removed from the list added to the email.
<?php
/**
* Set which user fields are added as "Extra Fields" to the admin checkout confirmation email.
*
* 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 / add-user-fields-to-account-bullets.php
Created May 9, 2024 08:00
Show user fields (user meta) as bullets on the PMPro Membership Account page.
<?php
/**
* Add user fields to the account page bullets.
*
* 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_account_bullets_add_user_meta() {
<?php
/**
* Change the admin email address for Paid Memberships Pro 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_change_admin_to_email( $user_email, $email ) {
@ipokkel
ipokkel / membership-card.php
Created May 3, 2024 07:35
Example Membership Card template with a custom end date function that returns the furthest end date or next payment date for a user's level(s).
<?php
/**
* Template: Membership_Card
* Version: 1.1.3
*
* Example Membership Card template with a custom end date function
* that returns the furthest end date or next payment date for a user's level(s).
*
* Requires PMPro 3.0 or higher to check next payment date for recurring subscriptions.
*