Skip to content

Instantly share code, notes, and snippets.

@kimwhite
kimwhite / change-we-accept-checkout-text.php
Created Oct 14, 2021 — forked from andrewlimaza/change-we-accept-checkout-text.php
Change the We Accept Checkout Text for Paid Memberships Pro.
View change-we-accept-checkout-text.php
<?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 Oct 7, 2021 — forked from greathmaster/pmpro-format-phone-number.php
Actively formats phone number into XXX-XXX-XXXX format
View pmpro-format-phone-number.php
<?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/
*/
@kimwhite
kimwhite / force-top-discount-code-field-to-always-open.php
Last active Oct 5, 2021 — forked from greathmaster/force-top-discount-code-field-to-always-open.php
Register Helper code to force top discount code field to be visible
View force-top-discount-code-field-to-always-open.php
<?php // do not copy this line.
/**
* This recipe will force the top discount code to be open without clicking anything
* Works with the Registration Helper Add On activated. https://www.paidmembershipspro.com/add-ons/pmpro-register-helper-add-checkout-and-profile-fields/
*
* 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 Sep 29, 2021 — forked from ipokkel/my-gettext-shipping.php
Change text for PMPro Shipping
View my-gettext-shipping.php
<?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 Sep 27, 2021 — forked from strangerstudios/pmpro_after_change_author_level_update_posts.php
Unpublish an author's posts or cpt when their membership is cancelled.
View pmpro_after_change_author_level_update_posts.php
<?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,
View escape_html_sample.php
<?php
$custom_approved_message = '<p>'. esc_html( 'This is my message. '). '<strong>'. esc_html('This text is bold.') .'</strong><br>' . esc_html($membership_level_name . ' level.' ) . '</p>';
@kimwhite
kimwhite / pmpro-approvals-custom-message-data.php
Last active Sep 20, 2021 — forked from ipokkel/pmpro-approvals-custom-message-data.php
Create a custom message email variable for PMPro Approvals Add On.
View pmpro-approvals-custom-message-data.php
<?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 / stack-credit-card-fields.css
Last active Sep 15, 2021
CSS to stack stripe credit card fields on PMPro Checkout Page
View stack-credit-card-fields.css
.pmpro_checkout_gateway-stripe form.pmpro_form #pmpro_payment_information_fields .pmpro_checkout-fields,
.pmpro_billing_gateway-stripe form.pmpro_form #pmpro_payment_information_fields .pmpro_checkout-fields {
display: block;
}
@kimwhite
kimwhite / my-pmpro-reset-password.php
Last active Sep 15, 2021
Change the priority of the PMPro password message
View my-pmpro-reset-password.php
<?php // do not copy this line.
/**
* This recipe change priority of retrieve password 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/
*/
@kimwhite
kimwhite / pmpro-move-company-bililng.php
Last active Sep 10, 2021 — forked from ronalfy/pmpro-move-company-bililng.php
Paid Memberships Pro - Move custom Field to Billing
View pmpro-move-company-bililng.php
<?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>