Skip to content

Instantly share code, notes, and snippets.

View kimwhite's full-sized avatar

Kim White kimwhite

View GitHub Profile
@kimwhite
kimwhite / pmpro-restrict-levels.php
Last active October 24, 2022 19:06 — forked from greathmaster/pmpro-restrict-levels.php
Only show levels on levels page which the original referral page belonged to.
<?php // do not copy this line.
/**
* 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/
*/
/*
Only show levels on level page which the original content belonged to. For example if a site has 3 levels: Bronze, Silver, Gold and
@kimwhite
kimwhite / pmpro-grace-period.php
Last active April 19, 2023 16:15 — forked from travislima/pmpro-grace-period.php
Add a "Grace Period" to a Paid Memberships Pro Membership (After expiration date is met). by level
<?php
/*
* The Code Recipe will add a 15-day grace period to a members membership once the membership expires.
* for specific levels, change line 13 to your level ID
* Add this Code Recipe to a PMPro Customization Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* For more information on Paid Memberships Pro - www.paidmembershipspro.com
*/
function my_pmpro_membership_post_membership_expiry( $user_id, $level_id ) {
// Make sure we aren't already in a grace period for this level
@kimwhite
kimwhite / set-user-to-active-whenever-imported.php
Last active October 2, 2023 07:14 — forked from andrewlimaza/reset-user-to-pending-whenever-imported.php
Importing from CSV. make sure Approved members show up on directory
<?php
/**
* Make sure approved users are active whenever you run an import using the Import Users From CSV Integration for Paid Memberships Pro.
*
* 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-member-number-csv.php
Last active September 21, 2022 12:39 — forked from greathmaster/pmpro-member-number-csv.php
Show member number in Members List and Members List CSV export.
<?php // do not copy this line.
/**
* This recipe Shows member number in Members List and Members List CSV export
* Requires PMPro Member Number Gist:
* https://github.com/strangerstudios/pmpro-snippets-library/blob/dev/frontend-pages/generate-unique-membership-number.php
*
* 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 / hide_my_pmpro_show_discount_code.php
Last active September 20, 2022 18:00 — forked from kimcoleman/hide_my_pmpro_show_discount_code.php
Only show the discount code fields if member is logged in
<?php
/**
* Only show the discount code fields if a code is passed in via URL paramter
*
* 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 hide_my_pmpro_show_discount_code_not_member( $show ) {
@kimwhite
kimwhite / pmpro-members-invoice-adjust-order-print.css
Last active September 20, 2022 11:54 — forked from andrewlimaza/pmpro-members-invoice-adjust-order-print.css
Adjust what is printed for the Paid Memberships Pro Members Invoice page
/**
* Add this code to your WordPress Customizer under "Additional CSS".
* Tweak the CSS on both areas to hide and show certain elements when printing the Members Invoice.
*/
@media print {
/** Hide stuff when printing **/
.pmpro-invoice .site-header, .pmpro-invoice .pmpro_actions_nav, .pmpro-invoice footer {
display:none;
}
@kimwhite
kimwhite / my_pmpro_checkout_level_renewal_pricing.php
Last active September 16, 2022 17:44 — forked from strangerstudios/my_pmpro_checkout_level_renewal_pricing.php
$25 discount when renewing the same level in Paid Memberships Pro
<?php // do not copy this line.
/**
* This recipe does will allow you to discount the price when someone renews at the same level for 1 level.
* Change line 14 to the amount to be discounted, change line 16 level 1 to the level ID for your own 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/
*/
@kimwhite
kimwhite / my-pmpro-redirect-non-members-to-another-page.php
Last active September 1, 2022 15:00 — forked from ipokkel/my-pmpro-redirect-non-members-to-another-page.php
This recipe will redirect non-members from a specific "slug" to the levels page.
<?php
/**
* This recipe will redirect non-members from a specific page to the levels 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-member-directory-clickable-usr-url.php
Last active August 24, 2022 12:57 — forked from ipokkel/pmpro-member-directory-clickable-usr-url.php
Display the user_url field as a clickable URL link on the PMPro Member Directory and Profile pages if the field was included in the shortcode's field attributes.
<?php
/**
* Show a clickable URL for the user_url profile field, with the word WEBSITE
* This will also stop the URL from being embedded with wp_oembed.
*
* 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 / simple_checkout_name_email_only_signup.php
Last active August 15, 2022 19:01 — forked from kimcoleman/simple_checkout_name_email_only_signup.php
Only require First Name, Last Name and Email address - works best for Free membership checkouts and when your paid checkout does not require Billing Address.
<?php
/**
* Only Username and Email address to create user.
* Name Fields only on Profile not checkout page
* This recipe requires Paid Memberships Pro and the Register Helper Add On.
*/
/**
* Hide the Account Information Section
*/