This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // do not copy this line. | |
/** | |
* This recipe will change the working Seat to what ever you choose | |
* | |
* use with Group Account Add On. https://www.paidmembershipspro.com/add-ons/group-accounts/ | |
* | |
* 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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do NOT copy this line | |
function hide_address_on_billing_update_if_stripe() { | |
global $pmpro_pages, $gateway; | |
// Bail if necessary | |
if ( empty( $pmpro_pages ) || ( ! is_page( $pmpro_pages['checkout'] ) && ! is_page( $pmpro_pages['billing'] ) ) ) { | |
return; | |
} | |
// Filter out Stripe billing fields | |
if ( ! empty( $gateway ) && 'stripe' === $gateway ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This recipe restricts all content of a Custom Post Type (CPT) | |
* to members only. | |
* | |
* This recipe assumes your CPT name is "recipe". | |
* You should replace this with your CPT name for the filter name | |
* and the $my_cpt variable's value. | |
* | |
* You can add this recipe to your site by creating a custom plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Generate a username at PMPro checkout from email for users. | |
* Hide your 'username' field using custom CSS. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_generate_username_at_checkout() { | |
// Make sure PMPro is installed and the function to get the level at checkout exists. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Password visibility toggle with Fontawesome eye icon. | |
* | |
* Adds an eye icon which on click reveals the password. | |
* This also works for the Signup Shortcode Add On. | |
* | |
* This code recipe assumes that the Fontawesome font library is already enqueued. | |
* | |
* You can add this recipe to your site by creating a custom plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Automatically delete user when their approval is denied. | |
* Add this code to your site by following: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function pmpro_approvals_delete_member_on_deny( $user_id, $level_id ) { | |
wp_delete_user( $user_id ); | |
} | |
add_action( 'pmpro_approvals_after_deny_member', 'pmpro_approvals_delete_member_on_deny', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Example of changing the group (location ) to add a user field to. | |
* | |
* "$where" locations available on the checkout page are: | |
* - after_pricing_fields | |
* - after_username | |
* - after_password | |
* - after_email | |
* - checkout_boxes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This creates two variables !!invoice_subtotal!! and !!invoice_tax!! to email templates where the !!invoice_id!! is available. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_add_invoice_details_to_email( $data, $email ) { | |
if ( isset( $data['invoice_id'] ) ) { | |
$invoice = new MemberOrder($data['invoice_id']); | |
$data['invoice_subtotal'] = isset( $invoice->subtotal ) ? pmpro_formatPrice( $invoice->subtotal ) : ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Copy from below here... | |
/* | |
* Add widget to checkout to get result of checkout_levels API call when button is pressed. | |
*/ | |
function my_pmpro_test_checkout_levels_api() { | |
?> | |
<hr/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This recipe will geocode the members based on their user account only. | |
* Run /wp-admin/?pmpromm_process_users=true to run the script. | |
* | |
* 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/ | |
*/ |
NewerOlder