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_bcc_other_emails.php
Last active April 23, 2025 10:43
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 / unset-billing-address-fields.php
Last active April 18, 2025 08:17 — 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.
@MaryOJob
MaryOJob / pmpro-change-admin-to-email.php
Last active March 20, 2025 14:27 — forked from andrewlimaza/pmpro-change-admin-to-email.php
Add bcc for PMPro admin emails [Paid Memberships Pro]
<?php // do not copy this line
/**
* Add bcc for PMPro admin emails
* Follow this guide to add custom code to your site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_email_headers_admin_emails($headers, $email) {
// bcc emails already going to admin_email
if (strpos($email->template, '_admin') !== false) {
@MaryOJob
MaryOJob / my_pmpro_custom_fields_multiple_location_headers.php
Last active December 19, 2024 09:03
Multiple Location / Headers for Custom User Fields Created with Code for Paid Memberships Pro
<?php // Do not copy this line
/**
* Add user fields using code with multiple headers.
* This example will add a Business, Study and Laptop Information section to your checkout and profile pages
*
* title: Add user fields using code.
* collection: user-fields
* category: custom-fields
*
@MaryOJob
MaryOJob / my_pmpro_always_show_renew_levels.php
Last active July 5, 2024 12:20 — forked from femiyb/my_pmpro_always_show_renew_levels.php
Always show renew links for certain PMPro levels if the member already has that level.
<?php // do not copy this line
/*
* This recipe would always show the renew link on the membership account page for the specified levels on line 13
* Add the below code to your PMPro Customizations Plugin:
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
// always show renew links for certain levels if the member already has that level.
//Enables comments for User Pages
function enable_comments_for_user_pages($postdata, $user, $level)
{
$postdata['comment_status'] = 'open';
return $postdata;
}
add_filter('pmpro_user_page_postdata', 'enable_comments_for_user_pages', 10, 3);
@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))