Skip to content

Instantly share code, notes, and snippets.

View femiyb's full-sized avatar
🏠
Working from home

Samuel Femi Taiwo femiyb

🏠
Working from home
View GitHub Profile
@femiyb
femiyb / rh_fields_example.php
Created May 3, 2019 16:20 — forked from andrewlimaza/rh_fields_example.php
Register Helper field type example shows an example of every possible field in Register Helper
<?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 March 28, 2019 19:17 — 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
<?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 March 21, 2019 12:51 — forked from strangerstudios/my_pmpro_after_change_membership_level.php
Only allow users to use the trial level once with Paid Memberships Pro.
<?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 October 17, 2018 09:48
Use the pmprowoo_get_membership_price filter to set prices for variable products with Paid Memberships Pro and WooCommerce
<?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 August 22, 2015 12:19
Our Register Helper Fields plugin from the August 19th, 2015 Webinar.
<?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 April 2, 2014 15:14
Only allow users to use the trial level once with Paid Memberships Pro.
<?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)
{