Navigation Menu

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 / my-pmpro-change-seat-text.php
Created January 15, 2024 16:54
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 / 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;
@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/
*/
<?php //do not copy
/**
* This recipe gets the payment plan associated with the level that is purchased
* and shows the relevant payment plan on the Membership Account page.
*
* This is used as a workaround when using the Payment Plans Add On only.
*
* 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.
@ipokkel
ipokkel / pmpro-fix-apostrophe-in-email-from-name-and-sitename.php
Created June 27, 2023 08:26
Replace double backslashes before apostrophe in the email From Name and replace apostrophe html code with an apostrophe in the sitename email placeholder variable.
<?php
/**
* Fix apostrophe's used in the from name and sitename email variable in emails.
*
* 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 / membership-expired-shortcode.php
Last active June 21, 2023 14:14
[membership_expired] shortcode
<?php
/**
* Add a shortcode to display content to members with an expired membership.
*
* Usage Example:
* [membership_expired]Shows if user's level expired[/membership_expired]
* [membership_expired level="1"]Shows if user's expired level ID matches[/membership_expired]
* [membership_expired levels="1, 2"]Shows if user's expired level ID matches one of the levels[/membership_expired]
*
* @param string $atts Shortcode level/levels IDs attributes.