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 / pmpro-restrict-email-levels.php
Last active August 12, 2020 15:36 — forked from ronalfy/pmpro-restrict-email-level.php
Paid Memberships Pro - Restrict Email for More Than One Level
<?php // Do not copy this line
/**
* Restrict Membership Signup by Email Domain
* Make sure to edit the $valid_domains array defined further below
* to include only the domains you'd like to allow.
*
* Add this code to a custom plugin. More info: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@MaryOJob
MaryOJob / my-default-wp-user-bio-checkout-fields.php
Last active November 2, 2020 20:50 — forked from ipokkel/my-default-wp-user-checkout-fields.php
Capture default user profile 'Biography' field (Biographical Info) at Membership Checkout using Register Helper and save with custom callback using save_function for RH
<?php
/**
* This recipe adds Biographical Info to the Membership Checkout.
*
* 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-australia-gst.php
Created September 10, 2020 06:29 — forked from strangerstudios/pmpro-australia-gst.php
Paid Memberships Pro - Australia GST
<?php
/*
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
*/
/*
// overwite the account shortcode
function overwite_pmpro_shortcode_account($atts, $content=null, $code="")
{
global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $levels;
// $atts ::= array of attributes
// $content ::= text within enclosing form of shortcode element
// $code ::= the shortcode found, when == callback name
// examples: [pmpro_account] [pmpro_account sections="membership,profile"/]
@MaryOJob
MaryOJob / a-gettext-filter-4-pmpro.php
Last active September 22, 2020 23:55 — forked from pbrocks/a-gettext-filter-4-pmpro.php
Sometimes we may want to change the wording of the language used in a plugin or theme, but don't want to edit code directly. A cleaner way to go is to use the built in filter that WordPress has called 'gettext'. This filter will search your codebase for translatable strings and replace when an exact match is found.
<?php // Do not copy this line
/**
* This filter will search your codebase for translatable strings and replace when an exact match is found.
*
* Here we're changing 'Membership' to 'Subscription' for Paid Memberships Pro.
*
* Add this code to your PMPro Customizations Plugin
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Note: When adding to your Customizations Plugin, be careful not to include the opening php tag on line 1 above.
*
@MaryOJob
MaryOJob / adjust_pmpro_email_according_to_level.php
Created November 3, 2020 09:52 — forked from andrewlimaza/adjust_pmpro_email_according_to_level.php
Change confirmation email contents in Paid Memberships Pro according to user level checkout.
<?php
/**
* Adjust email template according to user's level that they are checking out for.
* Add this code to your PMPro Customizations plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* For more information in customizing emails in Paid Memberships Pro visit - https://www.paidmembershipspro.com/documentation/member-communications/customizing-email-templates/
* List of available email templates - https://www.paidmembershipspro.com/documentation/member-communications/list-of-pmpro-email-templates/
*/
function adjust_pmpro_email_according_to_level( $email ){
@MaryOJob
MaryOJob / my-pmprorh-profile-picture.php
Last active April 19, 2021 08:56 — forked from ipokkel/my-pmprorh-avatar-and-logo.php
Multiple Upload Fields using PMPro Register Helper
<?php // Do Not Copy This Line
/*
* Add multiple upload fields to the profile 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/
*/
@MaryOJob
MaryOJob / pmprowoo_redirect_member.php
Last active December 4, 2020 00:04 — forked from andrewlimaza/pmproc_redirect_member.php
Redirect logged in members on level "1" away from the Shop and Contact page, to a custom page you have created.
<?php // Do no copy this line
//Copy lines 5 onwards into your PMPro custom plugin -> http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
function pmprowoo_redirect_member(){
if( is_user_logged_in() && function_exists('pmpro_hasMembershipLevel') && pmpro_hasMembershipLevel() ){ //check if user is logged in, pmpro is installed and user has an active level.
global $current_user;
$current_user->membership_level = pmpro_getMembershipLevelForUser($current_user->ID); //get current users level ID
@MaryOJob
MaryOJob / stop-renewing-members-multiple-levels.php
Last active June 10, 2022 16:25 — forked from travislima/stop-renewing-members.php
Stop different members on different levels from renewing their current membership level [Paid Memberships Pro].
<?php // Do not copy this line
/**
* Stop members from renewing their current membership level.
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function stop_members_from_renewing( $okay ) {
// If something else isn't okay, stop from running this code further.
@MaryOJob
MaryOJob / hide_prices_woo_pmpro.php
Last active December 17, 2020 05:02 — forked from andrewlimaza/hide_prices_woo_pmpro.php
Hide prices + add to cart button for non members Paid Memberships Pro and WooCommerce & Redirect Non Members away from Cart, Checkout & Single Products Page
<?php / DO NOT COPY THIS LINE PLEASE!!
/**
* Hide prices + add to cart from non members in Paid Memberships Pro.
* Redirect non members from cart, checkout and single products page.
* Add this custom code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Visit www.paidmembershipspro.com for assistance.
*/
function remove_my_woo_prices( $price, $product ) {