Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@kimwhite
kimwhite / my_gettext_pmpro_mailchimp.php
Last active February 19, 2025 15:27 — forked from strangerstudios/my_gettext_pmpro_mailchimp.php
Change wording in PMPro MailChimp Opt In Box
<?php // do not copy this line.
/**
* This recipe will Change wording in PMPro MailChimp Opt In Box
* Change the $translated_text = lines to the text you want.
*
* 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/
*/
@kimwhite
kimwhite / change-we-accept-checkout-text.php
Created October 14, 2021 19:25 — forked from andrewlimaza/change-we-accept-checkout-text.php
Change the We Accept Checkout Text for Paid Memberships Pro.
<?php
/**
* This recipe will change wording on your payment 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/
*/
@kimwhite
kimwhite / pmpro-format-phone-number.php
Last active October 7, 2021 15:07 — forked from greathmaster/pmpro-format-phone-number.php
Actively formats phone number into XXX-XXX-XXXX format
<?php // do not copy this line.
/**
* This recipe will Actively formats phone number into XXX-XXX-XXXX format
* on the PMPro chekcout page. if not using the billing phone, change line 18 # to be the id of your custom 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/
*/
<?php // do not copy this line.
/**
* This recipe will force the top discount code to be open without clicking anything
*
* 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/
*/
@kimwhite
kimwhite / my-gettext-shipping.php
Last active September 29, 2021 20:07 — forked from ipokkel/my-gettext-shipping.php
Change text for PMPro Shipping
<?php
/**
* This recipe changes text for the PMPro Shipping 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/
*/
@kimwhite
kimwhite / pmpro_after_change_author_level_update_posts.php
Last active September 27, 2021 17:44 — forked from strangerstudios/pmpro_after_change_author_level_update_posts.php
Unpublish an author's posts or cpt when their membership is cancelled.
<?php function pmpro_after_change_author_level_update_posts( $level_id, $user_id ) {
//get the user roles
$usermeta = get_userdata($user_id);
$user_roles = $usermeta->roles;
//check if the user is an author and is cancelling
if ( in_array( 'author', $user_roles ) && $level_id == 0 ) {
//get the user's posts
$args = array(
'author' => $user_id,
@kimwhite
kimwhite / pmpro-approvals-custom-message-data.php
Last active September 20, 2021 20:50 — forked from ipokkel/pmpro-approvals-custom-message-data.php
Create a custom message email variable for PMPro Approvals Add On.
<?php
/**
* This recipe adds a custom message per membership level to PMPro_Approvals email data.
*. ADDED - Custom Shortcode to add to Subject Line !!custom_subject!!
* This recipe assumes that the !!custom_approved_message!! variable was added to the
* Approvals - Approved Email template, and
* the !!custom_denied_message!! variable was added to the
* Approvals - Denied Email template.
*
* You can add this recipe to your site by creating a custom plugin
@kimwhite
kimwhite / pmpro-move-company-bililng.php
Last active September 10, 2021 15:27 — forked from ronalfy/pmpro-move-company-bililng.php
Paid Memberships Pro - Move custom Field to Billing
<?php
/**
* Move custom date field above address 1 line.
*/
function pmpro_move_custom_to_billing() {
if ( is_page( 'membership-checkout' ) && wp_script_is( 'jquery', 'done' ) ) {
?>
<script>
jQuery( '#date_of_birth_div' ).prependTo( '.pmpro_checkout-field-baddress1' );
</script>
@kimwhite
kimwhite / change_text_pmpro_card.php
Last active September 2, 2021 17:46 — forked from andrewlimaza/change_text_pmpro_advanced_levels.php
Change text for 'Return To Account' for PMPro Membership Card Page
<?php
/**
* Change text for the Return To Home and Return to Account for PMPro Advanced Levels add-on.
* Add the following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function pmpro_change_text_for_card( $translated_text, $text, $domain ){
switch ( $translated_text ) {
@kimwhite
kimwhite / my-pmpro-confirmation-url.php
Created September 1, 2021 14:07 — forked from ipokkel/my-pmpro-confirmation-url.php
Redirect certain levels to a custom confirmation page after checkout.
<?php
/**
* This recipe will redirect free level (1) to the levels page after registering
*
* 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_confirmation_url( $url, $user_id, $level ) {