Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@MaryOJob
MaryOJob / my_pmprowc_free_shipping_example.php
Last active Jan 18, 2023 — forked from JarrydLong/my_pmprowc_free_shipping.php
Give members of specific level IDs Free Shipping on orders above $75 in your WooCommerce store.
View my_pmprowc_free_shipping_example.php
<?php // Do not copy this line
/**
* Add the following code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Give members of level 1 or 2 Free Shipping when free shipping is available (must set free shipping as an option in store settings).
* Change $pmprowc_free_shipping_levels = array(1,2); to include level IDs that receive free shipping
*/
function my_pmprowc_free_shipping( $rates, $package ) {
@MaryOJob
MaryOJob / my_pmpro_email_attachments.php
Created Dec 15, 2022 — forked from strangerstudios/my_pmpro_email_attachments.php
Add an attachment to confirmation emails in Paid Memberships Pro
View my_pmpro_email_attachments.php
/*
Add an attachment to confirmation emails.
Requires PMPro v1.7.14+
*/
function my_pmpro_email_attachments($attachments, $email)
{
//make sure it's a checkout email (but not the admin one)
if(strpos($email->template, "checkout_") !== false && strpos($email->template, "admin") === false)
{
@MaryOJob
MaryOJob / generate_member_number.php
Last active Dec 8, 2022 — forked from kimwhite/generate_member_number.php
Code to generate incremental Member Number values for PMPro users/members.
View generate_member_number.php
<?php // do not copy this line.
/**
* This recipe creates Member Numbers
* Change the generate_member_number function if your member number needs to be in a certain format.
* Member numbers are generated when users are registered or when the membership account page is accessed for the first time.
*
* 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 / member_days_left_pmpro.php
Created Nov 15, 2022 — forked from andrewlimaza/member_days_left_pmpro.php
Show "Days Left" for Paid Memberships Pro
View member_days_left_pmpro.php
<?php
//Copy lines 5 onwards into your PMPro Customizations plugin -> https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
/**
* Add days left to members list
*/
function my_pmpro_days_left_members_list_col_header( $theusers )
{
?>
@MaryOJob
MaryOJob / pmpro-change-level-recurring.php
Created Nov 15, 2022 — forked from ronalfy/pmpro-change-level-recurring.php
PMPro - Change Never Label Message for Recurring Levels
View pmpro-change-level-recurring.php
<?php
/**
* Changes the output label to Recurring in member/order lists for recurring levels.
*
* 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 / no-oembed-pmpromd-pages.php
Created Nov 9, 2022 — forked from ipokkel/no-oembed-pmpromd-pages.php
Prevent oembeds from running on the PMPro Member Directory Add On pages.
View no-oembed-pmpromd-pages.php
<?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
View pmpro_pmpro_not_logged_in_text_filter.php
<?php
/**
* Edit Teaser Messages Depending on Content
*
*/
function pmpro_pmpro_not_logged_in_text_filter( $text ) {
global $post;
$access = pmpro_has_membership_access( $post->ID, NULL, true );
$level_ids = $access[1];
@MaryOJob
MaryOJob / my-pmprorh-extra-fields-admin-email.php
Created Sep 29, 2022 — forked from ipokkel/my-pmprorh-extra-fields-admin-email.php
Add Register Helper fields to the admin checkout notification email.
View my-pmprorh-extra-fields-admin-email.php
<?php
/**
* Add Custom Registration Fields and their values to the Admin Checkout Notification Email.
*
* 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 / pmpro-extra-fields.php
Created Sep 22, 2022 — forked from ronalfy/pmpro-extra-fields.php
PMPro - Add Extra Fields - Sync with Add User from Admin
View pmpro-extra-fields.php
<?php
/**
* Modified customer gist. Adds profile fields and saves them.
* Compatible with Add User from Admin Add-On
*
* 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 / pmpro-limited-time-registration.php
Created Mar 11, 2022 — forked from JarrydLong/pmpro-limited-time-registration.php
Restrict a membership level to no longer allow sign ups after a given date (limited time offer) using Paid Memberships pro
View pmpro-limited-time-registration.php
<?php
/* Checks to see if a registration is happening after a given date; if so, prevent registration and stop new signups for the level/no longer display the level on the levels page
*/
global $pmproml_start_date, $pmproml_end_date, $pmproml_limited_level_id;
$pmproml_limited_level_id = array( 1, 2, 4 ); // change to the ID of the limited-time membership level
$pmproml_start_date = "2019/04/01"; // change to the date registration starts, in YYYY/MM/DD format
$pmproml_end_date = "2019/04/30"; // change to the date registration ends, in YYYY/MM/DD format