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
@dparker1005
dparker1005 / memberslist_billing_address.php
Created February 28, 2024 16:12
Add the "billing address" column back to the members list and CSV export.
<?php
/**
* Add the "billing address" column back to the members list and CSV export.
*
* Note: This will add the most recent billing address for the user and level
* by looking at the user's order history, not user meta.
*
* 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.
@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/
@dwanjuki
dwanjuki / my_pmpromd_add_target_blank_to_url_fields.php
Last active May 1, 2024 13:43
Make website links on Member directory/profile pages open in new tab
<?php
/**
* Make user-submitted website links on Member directory/profile pages open in new tab
* Add names of fields with URLs to line 13
*
* 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/
*/
@dwanjuki
dwanjuki / restrict-page-cat-pmpro.php
Last active October 16, 2023 15:40 — forked from andrewlimaza/restrict-cpt-cat-pmpro.php
Restrict pages by category
<?php
/**
* Restricts pages based on category.
* Add categories to pages via a plugin: https://wordpress.org/plugins/pages-with-category-and-tag/
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_restrict_page_categories( $hasaccess, $post, $user, $post_membership_levels ) {
global $wpdb;
@kimwhite
kimwhite / my-pmpro-link-phone-on-directory-profile.php
Last active May 1, 2024 13:43
Display members phone number as a tel: link on your directory profile page.
@dwanjuki
dwanjuki / my_pmpro_live_price.php
Last active January 11, 2024 15:01
Show live price after sponsored seats section at checkout
<?php
/*
* Show live price after sponsored seats section at checkout
*
* You can add this recipe to your site by creating a custom plugin
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_live_price( $param ) {
$sponsor_levels = array( 7, 9, 11 ); // live price shown for these level IDs only
if( ! in_array( $_REQUEST['level'], $sponsor_levels ) ) {
@ipokkel
ipokkel / pmpro-memberslist-text-change.php
Created September 25, 2023 10:54
Change or translate text strings on the administrative PMPro Members List page.
<?php
/**
* Change or translate text for the Members List 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/
*/
function my_pmpro_memberslist_text_change( $translated_text, $original_text, $domain ) {
@MaryOJob
MaryOJob / pmpro-add-on-learn-dash.php
Created September 15, 2023 12:26 — forked from ronalfy/pmpro-add-on-learn-dash.php
Paid Memberships Pro - Add On Packages Plus LearnDash
<?php
global $pmpro_addon_pages_for_courses;
// 28 is the page ID; 24 is the course ID.
// 30 is the page ID; 26 is the course ID.
$pmpro_addon_pages_for_courses = array(
28 => 24,
30 => 26,
);
function pmproap_learndash_template_redirect()
{
@dwanjuki
dwanjuki / my_pmpro_remove_payment_plans_if_discount_code_applied.php
Created August 29, 2023 13:25
Remove Payment Plans at checkout if a valid discount code is passed in via the URL
<?php // do not copy this line
/**
* Remove Payment Plans at checkout if a valid discount code is passed
* in via the URL
*
* 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
/**
* This recipe assigns the readonly attribute to specific fields on the profile edit 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/
*/