Skip to content

Instantly share code, notes, and snippets.

View tenkabuto's full-sized avatar
🤓
Contributing to a project

Brandon Hall tenkabuto

🤓
Contributing to a project
View GitHub Profile
@tenkabuto
tenkabuto / gist:2d18acf93979f6f745da5af639a20e0c
Created December 29, 2017 23:59 — forked from strangerstudios/gist:5573829
Paid Memberships Pro customization to only let members of a certain level checkout if a discount code was used.
/*
Only let level 1 members sign up if they use a discount code.
Place this code in your active theme's functions.php or a custom plugin.
*/
function my_pmpro_registration_checks_require_code_to_register($pmpro_continue_registration)
{
//only bother if things are okay so far
if(!$pmpro_continue_registration)
return $pmpro_continue_registration;
@tenkabuto
tenkabuto / my_template_redirect_upgrade.php
Last active December 29, 2017 20:21 — forked from strangerstudios/my_template_redirect_upgrade.php
Redirect away from the checkout page if you don't have a required level with Paid Memberships Pro.
/*
Redirect away from the checkout page if you don't have a required level.
*/
function my_template_redirect_upgrade()
{
global $pmpro_pages, $pmpro_level;
if(empty($pmpro_pages))
return;