Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Sjolshagen eighty20results

View GitHub Profile
View Add Canadian provinces
<?php
function my_add_pmpro_state_abbrev( $states )
{
// Canadian province abbreviations
$provinces = array(
"AB",
"BC",
"MB",
"NB",
View RH_1.php
<?php
//we have to put everything in a function called on init, so we are sure Register Helper is loaded
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
if(!function_exists("pmprorh_add_registration_field"))
{
return false;
}
View RH_family_members.php
//we have to put everything in a function called on init, so we are sure Register Helper is loaded
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
if(!function_exists("pmprorh_add_registration_field"))
{
return false;
}
//define the fields
$fields = array();
View BP_avatar_widget
function pmpro_my_get_paying_member_ids()
{
global $pmpro_levels;
global $wpdb;
$user_ids = array();
$paying_levels = array();
foreach( $pmpro_levels as $level ) {
View pmpro_category_level_functions
/** Accepts a level ID and returns all categories protected by that level(id) **/
function pmpro_getCategoriesForLevel($level_id)
{
global $wpdb;
$sql = "SELECT category_id FROM {$wpdb->pmpro_memberships_categories} WHERE membership_id = %d";
$sql = $wpdb->prepare($sql, $level_id);
return $wpdb->get_results($sql);
}
@eighty20results
eighty20results / checkout.php
Created Jan 15, 2016
Checkout.php template that won't show payment options fields unless user is logged in
View checkout.php
<?php
global $gateway, $pmpro_review, $skip_account_fields, $pmpro_paypal_token, $wpdb, $current_user, $pmpro_msg, $pmpro_msgt, $pmpro_requirebilling, $pmpro_level, $pmpro_levels, $tospage, $pmpro_show_discount_code, $pmpro_error_fields;
global $discount_code, $username, $password, $password2, $bfirstname, $blastname, $baddress1, $baddress2, $bcity, $bstate, $bzipcode, $bcountry, $bphone, $bemail, $bconfirmemail, $CardType, $AccountNumber, $ExpirationMonth,$ExpirationYear;
/**
* Filter to set if PMPro uses email or text as the type for email field inputs.
*
* @since 1.8.4.5
*
* @param bool $use_email_type, true to use email type, false to use text type
View pmpro_austrian_vat_filter.php
<?php
/*
Plugin Name: PMPro VAT for Austria
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: PMPro: VAT for Austria
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
View pmpro-show-all-directory-users.php
<?php
/*
Plugin Name: PMPro Directory Customization
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Show all PMPro Users in directory (regardless of status).
Version: .1
Author: Thomas Sjolshagen @ Stranger Studios <thomas@eighty20results.com>
Author URI: http://www.strangerstudios.com
*/
@eighty20results
eighty20results / pmpro-billing-info-in-profile.php
Last active Feb 16, 2016
Add billing info to the users profile
View pmpro-billing-info-in-profile.php
<?php
/*
Use PMPro Register Helper to add PMPro Billing Address fields to the edit user page for admins.
*/
function my_show_pmpro_address_fields_in_profile()
{
//require PMPro and PMPro Register Helper
if(!defined('PMPRO_VERSION') || !defined('PMPRORH_VERSION'))
return;
@eighty20results
eighty20results / pmpro-rh-for-legacy-brands.php
Created Feb 16, 2016
Register Helper fields that also use the default WordPress meta field names for "First name" and "Last name".
View pmpro-rh-for-legacy-brands.php
<?php
function my_add_pmpro_RH_fields()
{
//require PMPro and PMPro Register Helper
if (!defined('PMPRO_VERSION') || !defined('PMPRORH_VERSION'))
return;
$fields = array();
$fields[] = new PMProRH_Field(
"first_name", // Input name, will also be used as the key to access as user meta
You can’t perform that action at this time.