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
@MaryOJob
MaryOJob / move-user-field-to-account-information-js.php
Created February 19, 2026 16:59 — forked from ipokkel/move-user-field-to-account-information-js.php
Example jQuery JavaScript to move custom PMPro user field(s)s to after the email field(s) on the checkout page.
<?php
/**
* Moves custom PMPro user fields after the email fields using JavaScript.
*
* 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_pmpro_move_user_field_to_account_information() {
@MaryOJob
MaryOJob / pmpro-block-checkout-if-has-membership-level.php
Created February 10, 2026 11:13 — forked from ipokkel/pmpro-block-checkout-if-has-membership-level.php
Stop and prevent members from checking out for a membership level they are already a member of.
<?php
/**
* Prevent users from checking out for a specific set of levels if they already have that level.
*
* Set the $blocked_levels array to the level ids you want to block in each function.
*
* 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/
@MaryOJob
MaryOJob / my_pmpro_change_level_if_approved.php
Last active January 29, 2026 11:07
Add another membership level on approval, if member is approved when using the Approvals Add On
<?php // Do not copy this line
/**
* Add another membership level on approval, if member is approved when using the Approvals Add On
* Please add the below code to your custom plugin or Code Snippets Plugin by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_level_if_approved( $user_id, $level_id ) {
// Only run if the approved level is the Entry level
$entry_level_id = 14; // Replace with your Entry Level ID
$new_level_id = 1; // Level to add after approval
<?php
/**
* Enable comment support for the pmpro_lesson custom post type.
*
* Allowing users to comment on lessons may be set with the "Allow comments"
* checkbox option in the "Discussion" metabox on the lesson edit screen.
*
* 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.
@MaryOJob
MaryOJob / my_pmpro_vat_tax_wording.php
Last active December 2, 2025 09:14
Change the VAT Tax Add On Section Title on the PMPro Checkout Page
<?php // Do not copy this line
/**
* Add this code to a PMPro Customization Plugin: https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/
**/
function vat_gettext_membership( $output_text ) {
$output_text = str_replace( 'Members in the EU will be charged a VAT tax', 'Members will pay Tax', $output_text );
return $output_text;
}
@MaryOJob
MaryOJob / add-custom-column-to-post-page-list.php
Created November 26, 2025 21:05 — forked from kimwhite/add-custom-column-to-post-page-list.php
Add a "Requires Membership" column to the All Pages and All Post dashboard page to show what levels are required to view. Raw
<?php
/**
* Add a “Requires Membership” column to the Posts and Pages lists in the WordPress admin.
*
* title: Add a “Requires Membership” Column to Posts and Pages
* - shows which membership levels are required to view each post or page.
* layout: snippet
* collection: admin-pages
* category: admin
* link: TBD
@MaryOJob
MaryOJob / my-pmpro-show-renew-link-when-level-expires-in-x-days.php
Created October 31, 2025 08:12 — forked from ipokkel/my-pmpro-show-renew-link-when-level-expires-in-x-days.php
Show renewal link X days before expiration by hooking into pmpro_member_action_links. This is an alternative method to the one used in this guide: https://www.paidmembershipspro.com/schedule-renew-link-display/
<?php
/**
*
* ===== WARNING =====
* This code recipe is intended for developers and requires extensive knowledge of websites, and WordPress.
* Copying and pasting this recipe into your site as-is won't work - you need to follow the steps outlined in this code.
* If you are unsure, please hire a local WordPress developer or freelance for assistance.
*
* This code recipe is experimental and was built for private use, outside of Paid Memberships Pro and it's support scope.
*
@MaryOJob
MaryOJob / my_login_page_add_checkbox.php
Last active September 20, 2025 08:30
Add a Checkbox to Login Page on a WordPress Website
<?php // Do not copy this line please.
/*
* Please add the below code to your custom plugin or Code Snippets Plugin by following this guide: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
// As part of WP authentication process, call our function
add_filter('wp_authenticate_user', 'wp_authenticate_user_acc', 10, 2);
function wp_authenticate_user_acc($user, $password) {
@MaryOJob
MaryOJob / unset-billing-address-fields.php
Last active September 12, 2025 13:10 — forked from ipokkel/remove-billing-address-fields.php
Makes All billing Address Fields Not Required At checkout.
<?php // do not copy this line
/**
* This recipe makes all billing fields on the checkout page not required
*
* Note: Make sure your Gateway doesn't require these 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.