Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working remotely 😈

Mary Job MaryOJob

🏠
Working remotely 😈
View GitHub Profile
@MaryOJob
MaryOJob / my_pmpro_change_text_page_example.php
Created Aug 13, 2020
Change PMPro Wording on Edit Profile Page
View my_pmpro_change_text_page_example.php
<?php
/**
* This recipe changes the text 'Cancel' only on the Edit Profile Page because the word also appears on the Membership accounts page
* This should be added to a PMPro Customizations or Code Snippets Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* Thank you to Ronald, for assisting in writing this snippet.
**/
function pmpro_init_cancel_gettext() {
add_filter( 'gettext', 'pmpro_change_cancel_text_gettext', 10, 3 );
@MaryOJob
MaryOJob / pmpro-restrict-email-levels.php
Last active Aug 12, 2020 — forked from ronalfy/pmpro-restrict-email-level.php
Paid Memberships Pro - Restrict Email for More Than One Level
View pmpro-restrict-email-levels.php
<?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 / pmpro-rh-ec-fields.php
Created Aug 10, 2020 — forked from ronalfy/pmpro-rh-ec-fields.php
Paid Memberships Pro Register Helper Adding Emergency Contact Fields
View pmpro-rh-ec-fields.php
<?php
// We have to put everything in a function called on init, so we are sure Register Helper is loaded.
function pmpro_register_field_peakbagger_init() {
// Don't break if Register Helper is not loaded.
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
pmprorh_add_checkout_box( 'contact', 'Contact Information' );
pmprorh_add_checkout_box( 'emergency', 'Emergency Contact Information' );
@MaryOJob
MaryOJob / my_pmpro_change_text_example.php
Last active Jul 15, 2020 — forked from kimwhite/my_pmpro_change_text_example.php
Change text example in a PMPro Page Template.
View my_pmpro_change_text_example.php
<?php // Do Not Copy This Line Please
/**
* This recipe replaces text strings in the content filter.
*
* 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 / my_pmpro_rearrange_billing_fields.php
Last active Jun 19, 2020
Move the Country field back to the bottom after post code when using the pmpro address for free levels add-on and pmpro state dropdown add-on
View my_pmpro_rearrange_billing_fields.php
<?php // Do not copy this line
function my_pmpro_fix_billing_fields() {
?>
<script>
jQuery(document).ready(function() {
jQuery("#pmpro_billing_address_fields>.pmpro_checkout-fields").append( jQuery( ".pmpro_checkout-field-bcity" ) );
jQuery("#pmpro_billing_address_fields>.pmpro_checkout-fields").append( jQuery( ".pmpro_checkout-field-bzipcode" ) );
jQuery("#pmpro_billing_address_fields>.pmpro_checkout-fields").append( jQuery( ".pmpro_checkout-field-bcountry" ) );
jQuery("#pmpro_billing_address_fields>.pmpro_checkout-fields").append( jQuery( ".pmpro_checkout-field-bphone" ) );});
@MaryOJob
MaryOJob / my_pmproan2c_change_priority.php
Last active Jun 17, 2020 — forked from ipokkel/my_pmproan2c_change_priority.php
Reorder the PMPro "Add First and Last Name (add-on)" field setting it to display after the username field
View my_pmproan2c_change_priority.php
<?php // Do not copy this line
/* Load add name to checkout (pmproan2c) earlier than default
* Can be used to reposition name fields when multiple custom fields are
* loaded after the username field on the checkout page
*/
function my_pmproan2c_change_priority() {
remove_action( 'pmpro_checkout_after_password', 'pmproan2c_pmpro_checkout_after_password' );
add_action( 'pmpro_checkout_after_username', 'pmproan2c_pmpro_checkout_after_password' );
}
@MaryOJob
MaryOJob / strike-pmpro-woo.php
Created Jun 12, 2020 — forked from andrewlimaza/strike-pmpro-woo.php
Strike pricing for WooCommerce and Paid Memberships Pro pricing.
View strike-pmpro-woo.php
<?php
/**
* This will add strike through pricing if the membership pricing is available for currrent user viewing Woo store.
* Add this code (Line 8 onwards) to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmprowoo_strike_prices( $price, $product ) {
global $pmprowoo_member_discounts, $current_user;
$level_id = $current_user->membership_level->id;
@MaryOJob
MaryOJob / redirect_after_pmpro_checkout.php
Last active Jun 12, 2020 — forked from ugonkwocha/PMPro Gist
Redirect to another page / site after a PMPro checkout.
View redirect_after_pmpro_checkout.php
<?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_pmpro_redirect_to_home.php
Last active May 29, 2020
Redirect all WP User roles except Subscribers to Home Page
View my_pmpro_redirect_to_home.php
<?php // DO NOT COPY THIS LINE
/**
* Redirect all non-subscriber users' after they login to your website's home page.
* Documentation for login_redirect filter - https://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect
*/
function pmpro_redirect_after_login( $redirect_to, $request, $user ) {
if ( isset( $user->roles ) && is_array( $user->roles ) ) {
@MaryOJob
MaryOJob / my_pmpro_gift_level_1_example.php
Last active May 26, 2020
PMPro example configuration code for the Gift Membership Add-On (1)
View my_pmpro_gift_level_1_example.php
<?php
/* PMPro Gift Levels Example - See full information here: https://www.paidmembershipspro.com/add-ons/pmpro-gift-levels/*/
global $pmprogl_gift_levels;
$pmprogl_gift_levels = array(
// Also, set level 9 as a "Purchase Gift" membership level to create a customized level 10 gift.
9 => array(
You can’t perform that action at this time.