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 / my_pmpro_change_text_example.php
Last active March 1, 2024 09:03
PMPro - Change "Discount Code" Text Example on Checkout Page
<?php // Do Not Copy This Line
/**
* This recipe will help you change text on the checkout paid in PMPro
* 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/
*/
// paste content from below this line
function pmproc_change_my_text( $translated_text, $text, $domain ) {
@MaryOJob
MaryOJob / pmpro-australia-gst.php
Last active December 21, 2023 12:07 — forked from ideadude/pmpro-australia-gst.php
Paid Memberships Pro - Australia GST (Checkbox on by default)
<?php // do not copy this line
/*
Plugin Name: Paid Memberships Pro - Australia GST
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-australia-gst/
Description: Apply Australia GST to Checkouts with PMPro
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@MaryOJob
MaryOJob / my_pmpro_email_confirmation_text.php
Last active December 14, 2023 18:24 — forked from ideadude/my_pmpro_email_confirmation_text.php
Change the confirmation text when using PMPro and the Email Confirmation Add On.
<?php // do not copy this line
/**
* Change the "IMPORTANT!" confirmation text when using PMPro and the Email Confirmation Add On.
* Add this code into a custom plugin or code snippet.
* Be sure to change the translated lines below to the language and words you want.
* https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/
*/
function my_pmpro_email_confirmation_text( $translated_text, $text, $domain ) {
// Ignore strings for other plugins.
@MaryOJob
MaryOJob / redirect_after_pmpro_checkout.php
Last active October 27, 2023 12:12 — forked from ugonkwocha/PMPro Gist
Redirect to another page / site after a PMPro checkout.
<?php // DO NOT COPY THIS LINE
/* See full article here please: https://www.paidmembershipspro.com/set-up-unique-membership-confirmation-pages-based-on-level/
* Copy this into a PMPro Customizations Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
**/
function my_pmpro_confirmation_url($rurl, $user_id, $pmpro_level) {
if(pmpro_hasMembershipLevel(2))
$rurl = "https://online.9jacodekids.com/my-account/";
elseif(pmpro_hasMembershipLevel(3))
@MaryOJob
MaryOJob / my_pmprolpv_has_membership_access.php
Created October 12, 2023 13:41 — forked from messica/my_pmprolpv_has_membership_access.php
Limit Post Views: Don't allow post views for certain categories.
<?php
/**
* Limit Post Views: Don't allow post views for certain categories.
*/
function my_pmprolpv_has_membership_access( $has_access, $post ) {
// Set blocked categories here.
$blocked_categories = array( 'silver', 'gold' );
@MaryOJob
MaryOJob / my_pmpro_bcc_other_emails.php
Last active October 3, 2023 14:47
BCC Other Emails on Specific Email Templates - PMPro
<?php // DO NOT COPY THIS LINE, it will trigger a fatal error. Copy from below please!
/*
* Bcc admin on specific email templates only
* more then one can be added like this:
* $headers[] = "Bcc:" . "otheremail@domain.com,anotheremail@domain.com";
* You can change the conditional to check for a certain $email->template or some other condition before adding the BCC.
* Please add the below code to your site by following this guide:
* https://www.paidmembershipspro.com/how-to-add-code-to-wordpress/
*/
@MaryOJob
MaryOJob / my_pmpro_the_content_filter.php
Last active September 22, 2023 10:52
Change wording on any PMPro page using the WordPress `the_content` filter
<?php // Do not copy this line
/* This replaces all fields with 'state' with 'county'
* Add the code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
function my_replace_text_for_pmpro_pages($text) {
global $pmpro_pages;
if ( is_page( $pmpro_pages['checkout'] ) ){
// if ( is_page( $pmpro_pages['profile'] ) ){
@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()
{
@MaryOJob
MaryOJob / pmpro-lock-membership-levels-allow-renewal.php
Last active July 31, 2023 14:33 — forked from ipokkel/pmpro-lock-membership-levels-allow-renewal.php
PMPro Lock Membership Levels - Allow members to cancel their own level but not change their current level
<?php
/**
* This recipe allows members to cancel a locked membership level
* if the level was locked with PMPro Lock Membership Levels Add On.
*
* This recipe expects and requires the Membership Locked page set up
* and assigned under Memberships > Settings > Page settings.
* @link https://www.paidmembershipspro.com/add-ons/pmpro-lock-membership-level/#install
*
@MaryOJob
MaryOJob / no-oembed-pmpromd-pages.php
Created November 9, 2022 11:42 — forked from ipokkel/no-oembed-pmpromd-pages.php
Prevent oembeds from running on the PMPro Member Directory Add On pages.
<?php
/**
* Prevent oembeds from running on the PMPro Member Directory Add On pages.
*
* This may be helpful if any external or social URLs are listed on the directory
* or profile page.
*
* Can clear oembed cache with steps here: https://siteorigin.com/clearing-oembed-cache/
*
* You can add this recipe to your site by creating a custom plugin