Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@kimwhite
kimwhite / my-change-level-cost-text.php
Last active January 18, 2024 15:09
Prepend the Level Cost by level
<?php // do not copy this line.
/**
* This recipe will prepend your level cost for a specific level.
* Change 5 on line 12 with your level ID
* 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-pmpro-change-seat-text.php
Last active April 24, 2024 17:46
Group Add On Change seat or seats to something else
<?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/
@kimwhite
kimwhite / my-pmpro-update-cost-based-on-user-meta.php
Last active January 22, 2024 12:55
Update the level cost based on the user meta.
<?php
// Example of retriving usermeta to add to level cost at checkout.
// Requires Paid Memberships Pro and a custom meta field
// This is only proof of concept. Code may be modified to work on your site.
function my_pmpro_add_past_dues($level)
{
global $current_user, $pmpro_pages;
@kimwhite
kimwhite / change-advanced-levels-shortcode.php
Last active January 2, 2024 15:50 — forked from ipokkel/change-advanced-levels-shortcode.php
Change or translate text for PMPro Advanced Levels Shortcode using gettext filter #pmpro-advanced-levels-shortcode #translate
<?php
/**
* This recipe is an example of how to change or translate
* localized text strings for PMPro Advanced Levels Shortcode.
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*
* 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 //do not copy
/**
* This recipe sends a different 'Application Approved' email when approving a member
* in the Approvals Add On based on their level.
*
* Does not support email templates at this point in time. Subject & Body should be updated in the code below.
*
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Works for PayPal Express and Stripe payment gateways.
@kimwhite
kimwhite / my_login_redirect.php
Last active December 14, 2023 13:21 — forked from ideadude/my_login_redirect.php
Redirect all WordPress users to a very specific page on login.
<?php
/**
* Redirect all users to a very specific page on login.
* This should work no matter what login form/etc you are using.
* If it doesn't work, maybe the 999 priority needs to be higher.
* If you want to respect the redirect_to param or earlier callbacks
* that overwrite it, uncomment the section at the top of the function.
*
* You can add this code to your site using the Code Snippets plugin or by
* placing the code into a custom plugin or your theme's functions.php.
@kimwhite
kimwhite / my-pmpro-change-text-level.php
Last active December 8, 2023 21:36
Change the Word Level to something else.
<?php // do not copy this line.
/**
* This recipe will change the word LEVEL in a few places. More can be found.
*
* 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_change_text_example.php
Last active December 7, 2023 21:36 — forked from ipokkel/change_text_example.php
gettext change Resend Email Text
<?php
// Add this code below to your PMPro Customizations plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
add_filter( 'gettext', 'change_my_cost_example', 20, 3 );
/**
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
add_filter( 'gettext', 'change_my_cost_example', 20, 3 );
/**
@kimwhite
kimwhite / my-pmpro-hide-level.php
Last active December 5, 2023 20:32 — forked from kerijacoby/hide-level
Hide a level from non-members
<?php // do not copy this line.
/**
* This recipe will hide level 2 from non-members
*
* 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 adjusting_the_pmpro_levels_array( $levels ) {
@kimwhite
kimwhite / my_update_pmpro_stripe_statement_descriptor.php
Last active November 27, 2023 14:21 — forked from ideadude/my_update_pmpro_stripe_statement_descriptor.php
Change the statement descriptor for Stripe charges and subscriptions.
<?php
/**
* Change the statement descriptor for Stripe charges and subscriptions.
* This is the message shown on the customer's credit card statement.
* Must contain at least one letter, 22 characters max.
*
* Requires PMPro 2.4.1+
*
* Note: If your descriptor includes invalid characters or
* more than 22 chacters, checkout will fail.