Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@dwanjuki
dwanjuki / my_pmpro_stop_non_approved_members_logging_in.php
Last active February 22, 2024 22:20 — forked from andrewlimaza/pmpro-approvals-login-example.php
Stop non-approved members from logging in and display a message when using the Approvals Add On
<?php
/**
* Stop non-approved members from logging in and display a message when using the 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 / my-pmpro-set-user-field-addmember.php
Created April 4, 2023 05:18
Add PMPro User Fields as fields for Add Member from Admin.
<?php
/**
* Set addmember attribute on user fields to true.
*
* This will add the field to the Add Member from Admin page in the
* administration area.
*
* 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.
@kimwhite
kimwhite / my_pmpro_change_text_example.php
Last active November 23, 2022 16:51 — forked from femiyb/my_pmpro_change_text_example.php
PMPro - Change Text Example on Checkout Page by LEVEL
<?php // Do Not Copy This Line
/**
* This recipe will help you change text on the checkout paid by 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/
*/
// paste content from below this line
<?php //do not copy
/**
* This recipe update the level cost text based on the Country selected. This recipe will work
* with the VAT Tax Add On for EU customers.
*
* 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/
@sc0ttkclark
sc0ttkclark / login-link.html
Created June 3, 2021 01:54
Login link example for PMPro
@andrewlimaza
andrewlimaza / mmpu-woocommerce-enable.php
Created April 29, 2021 11:46
Allow user's to hold multiple levels with MMPU and WooCommerce for Paid Memberships Pro.
<?php
/**
* This allows user's to have multiple levels when purchasing via WooCommerce.
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
add_filter( 'pmprowoo_mmpu_force_add_level', '__return_true' );
@ipokkel
ipokkel / my-pmprosus-custom-email-password-string.php
Created March 24, 2021 06:51
Improve layout in confirmation emails sent when user checked out with PMPro Signup Shortcode set with the emailonly option. #pmpro-signup-shortcode #gettext
<?php
/**
* This recipe adds a line break after the password and email included in
* the confirmation email sent by PMPro Signup Shortcode when the option
* short is set to emailonly.
*
* To improve layout in the email you may use the Email Template Editor
* to change the layout of the !!user_email!! shortcode by removing the
* wrapping brackets.
*
@kimwhite
kimwhite / duplicate_usermeta_to_xprofile.php
Last active May 19, 2021 11:34 — forked from kimcoleman/duplicate_usermeta_to_xprofile.php
Duplicate usermeta fields as xprofile fields. Sync BuddyPress and PMPro
<?php
/**
* This recipe run a script to sync your PMPro Registration Fields with BuddPress xprofie fields
*
* Add this to a custom plugin then run by adding this to your domain `/wp-admin/?pmpromm_process=1`
* Remove when finished.
* 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
/**
* Creates shipping address fields for 'child' accounts when using the Sponsored/Group Members for Paid Memberships Pro.
* This requires the following attribute 'sponsored_accounts_at_checkout' => true for checkout.
* PLEASE NOTE: Using the Register Helper Add On (or similar) may interfere with this code if field names match.
*
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Skill Required: Advanced.
*/
@andrewlimaza
andrewlimaza / my-own-pmpro-pdf-variable-template.php
Created March 31, 2020 16:48
Add custom variables to PMPro PDF Invoices Templates
<?php
/**
* This example shows you how to create custom variables for your email templates.
* All customers that have purchased an 'All Access' pass get up to 5 custom variables created to help get you started.
* https://yoohooplugins.com/all-access
*/
function my_custom_pmpro_pdf_variable( $data_array, $user, $order_data ) {
$data_array['{{user_name_example}}'] = $user->user_nicename;
return $data_array;
}