Skip to content

Instantly share code, notes, and snippets.

View MaryOJob's full-sized avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@kimwhite
kimwhite / pmpro-stripe-order-description.php
Created October 26, 2021 18:05 — forked from greathmaster/pmpro-stripe-order-description.php
Add the membership level ID and name to the Stripe description
<?php // do not copy this line.
/**
* Add the membership level ID and name to the Stripe description
*
* 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/
*/
@ipokkel
ipokkel / period_to_lock_member_only_content_per_membership_level.php
Created October 6, 2021 12:45
Lock membership content for an additional period. This is handy for memberships that should have access to a members-only post after a certain time has passed depending on their level. E.g. Gold level has immediate access, silver has access after 7 days and bronze after one month the post was published.
<?php
/**
* Set a waiting period before unlocking a members-only post that
* the member's membership level has access to.
*
* To set which posts to unlock and their individual period (days)
* set the post id's as the array key and the period as the
* value of the array key of the $posts_to_unlock variable.
*
* You can add this recipe to your site by creating a custom plugin
@ipokkel
ipokkel / remove_cancel_and_change_links.php
Last active October 3, 2023 09:47
Remove cancel and change links from PMPro member action links on the Membership Account page.
@dparker1005
dparker1005 / disable_pmpropbc_send_invoice_email.php
Created September 2, 2021 13:57
Disables sending a invoice emails for check orders whenever an order is saved in success status.
<?php
/**
* Disables sending a invoice emails for check orders whenever an order is saved
* in success status.
*
* 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 recipe will display a list of pages/posts that are protected by adding the shortcode `[mypmpro_display_posts]` to a 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/
*/
@ipokkel
ipokkel / my-pmpro-remove-non-default-countries.php
Last active February 28, 2025 12:39
Remove all countries except the default PMPro country.
<?php
/**
* This recipe is an example of how to keep only the PMPro default country
* and remove all other countries from the "Country" dropdown select.
*
* The PMPro default country is "US" (United States), to set
* your custom default country, please refer to this article.
* @link https://www.paidmembershipspro.com/change-the-default-country-of-your-membership-website/
*
* For available countries and their shortcode see:
@ideadude
ideadude / my_add_select_all_levels.php
Created July 15, 2021 18:30
Add "select all" option inside the PMPro Require Membership box
<?php
/**
* Add "select all" option inside the Require Membership box
* 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_add_select_all_levels() {
?>
@dparker1005
dparker1005 / pmpro_profile_start_date_from_expiration.php
Created July 13, 2021 14:33
When a user with an enddate renews for a recurring subscription for the same level, do not charge the initial payment and set the first recurring payment date for their old enddate.
<?php
/**
* When a user with an enddate renews for a recurring subscription for the same level,
* do not charge the initial payment and set the first recurring payment date for their
* old enddate.
*
* 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/
@andrewlimaza
andrewlimaza / pmpro-lock-membership-levels-lock-all-existing-members.php
Last active March 7, 2022 16:56 — forked from greathmaster/pmpro-lock-membership-levels-lock-all-existing-members.php
PMPro Lock Membership Levels-lock existing members. Add this to your customizations plugin and refresh the page. Recommend deleting the code snippet after the operation is complete.
<?php
/**
* Bulk Update all member's with level ID 4 to be locked indefinitely.
* Run this code by adding to your site, loading a page. Once done, you may remove this code from your site.
*/
function bulk_lock_all_members() {
if ( ! current_user_can( 'manage_options' ) ) {
return;