Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Femi YB femiyb

🏠
Working from home
View GitHub Profile
@femiyb
femiyb / rh_fields_example.php
Created May 3, 2019 — forked from andrewlimaza/rh_fields_example.php
Register Helper field type example shows an example of every possible field in Register Helper
View rh_fields_example.php
<?php
/**
* This example is to show you the 'niche' options each Paid Memberships Pro - Register Helper Add-on field can take and how to use it.
* For more information on the Register Helper Add-on please visit https://www.paidmembershipspro.com/add-ons/free-add-ons/pmpro-register-helper-add-checkout-and-profile-fields/
**/
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
@LMNTL
LMNTL / pmpro-adjust-email-subject-to-level-checkout.php
Last active Mar 28, 2019 — forked from pbrocks/pmpro-adjust-email-content-to-level-checkout.php
This gist changes the subject line of the checkout email based on the member's level. - based on https://gist.github.com/pbrocks/abe099df6a462cb2353240af63a53959
View pmpro-adjust-email-subject-to-level-checkout.php
<?php
/**
* Change subject line of Checkout email based on membership level.
*
* @param string $subject The email's subject is a string of text that you can adjust here as you see fit or pull from another custom function.
* @param object $email This is the php object from which we extracting the appropriate level and to which we'll add the new email content.
* @return string Whichever condition applies in the function below will determine what string is supplied to the email object. If none of the conditions are met, the return string will be the original message subject.
*/
function pmpro_adjust_email_subject_to_level_checkout( $subject, $email ) {
@ideadude
ideadude / my_pmpro_after_change_membership_level.php
Last active Mar 21, 2019 — forked from strangerstudios/my_pmpro_after_change_membership_level.php
Only allow users to use the trial level once with Paid Memberships Pro.
View my_pmpro_after_change_membership_level.php
<?php
/*
Only allow users to use the trial level once.
Add this code to your active theme's functions.php
or a custom plugin.
Be sure to change the $trial_level_id variable in multiple places.
*/
//get trial level ids
function my_pmpro_trial_level_ids() {
// edit this to be a comma separated list of your trial level ids
@ideadude
ideadude / my_pmprowoo_get_membership_price.php
Last active Oct 17, 2018
Use the pmprowoo_get_membership_price filter to set prices for variable products with Paid Memberships Pro and WooCommerce
View my_pmprowoo_get_membership_price.php
<?php
/**
* Use the pmprowoo_get_membership_price filter to set prices for variable products.
* Update the $membership_prices array.
* Each item in that array should have a key equal to the membership level id,
* and a value equal to an array of the form array( {variable_product_id} => {member_price} )
*
* Add this code into a custom plugin.
*/
function my_pmprowoo_get_membership_price( $discount_price, $level_id, $original_price, $product ) {
@strangerstudios
strangerstudios / register_helper_webinar_sample_code.php
Created Aug 22, 2015
Our Register Helper Fields plugin from the August 19th, 2015 Webinar.
View register_helper_webinar_sample_code.php
<?php
/*
Plugin Name: Register Helper Example
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Register Helper Initialization Example
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@strangerstudios
strangerstudios / my_pmpro_after_change_membership_level.php
Created Apr 2, 2014
Only allow users to use the trial level once with Paid Memberships Pro.
View my_pmpro_after_change_membership_level.php
<?php
/*
Only allow users to use the trial level once.
Add this code to your active theme's functions.php
or a custom plugin.
Be sure to change the $trial_level_id variable in multiple places.
*/
//record when users gain the trial level
function my_pmpro_after_change_membership_level($level_id, $user_id)
{