Skip to content

Instantly share code, notes, and snippets.

View ipokkel's full-sized avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / rh_fields_example.php
Created March 25, 2019 05:53 — 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
@ipokkel
ipokkel / add-billing-to-add-member-and-profile.php
Last active December 2, 2022 04:29 — forked from andrewlimaza/add-billing-to-add-member-and-profile.php
Add Paid Memberships Pro Billing Address as required fields to Edit Profile, User Profile Edit (admin), and Add Member from Admin pages. #pmpro-register-helper
<? php
/**
* This will add billing fields to Add Member from Admin and the user profile edit pages.
*
* Optional: Set if fields should be required
*
* Requires Paid Memberships Pro and PMPro Register Helper plugins active.
*
* 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.
@ipokkel
ipokkel / my_pmprorh_init_with_geopicker.php
Created March 26, 2019 04:06 — forked from strangerstudios/my_pmprorh_init_with_geopicker.php
PMPro Register Helper Example to Embed MyGeoPosition.com GeoPicker
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();
@ipokkel
ipokkel / rh_example_location.php
Created March 26, 2019 20:46 — forked from andrewlimaza/rh_example_location.php
Change location where Register Helpers are shown depending if user is logged in or not for Paid Memberships Pro.
<?php
// Show the custom Register Helper Fields in a different location if the user is logged in.
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
if(!function_exists( 'pmprorh_add_registration_field' )) {
return false;
}
@ipokkel
ipokkel / pmpro-customizations-depends-required-example.php
Last active February 24, 2020 16:00
Register helper example to make a dependant field required
<?php
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();
@ipokkel
ipokkel / pmpro_member_directory_sql.php
Created April 2, 2019 07:57
Randomize user names for Paid Memberships Pro Member Directory and sort members according to level id or level name
<?php
function my_rand_directory($sqlQuery, $levels, $s, $pn, $limit, $start, $end, $order_by, $order) {
/**
* OPTIONS
*/
// Ternary: Set to 1 to sort by membership id or 0 to sort by membership name
$level_sort_by = 0 ? 'mu.membership_id' : 'm.name';
@ipokkel
ipokkel / my_init_change_pmpro_content_filter_priority.php
Last active January 8, 2020 10:33 — forked from strangerstudios/my_init_change_pmpro_content_filter_priority.php
Tell PMPro to filter the content a bit later to work with ProfitBuilder plugin
<?php // do NOT copy this line, copy from below this line
/*
Tell PMPro to filter the_content a bit later.
This will sometimes fix issues where theme or plugin elements (e.g. videos)
are not being filtered by PMPro. Note that this sometimes will cause
some things (e.g. share links) to be filtered that you don't want to be
filtered... and sometimes edits to the theme or a child theme are
required to get the desired effect.
@ipokkel
ipokkel / pmprosm-sponsor-level-example.php
Last active March 31, 2021 05:40
Sample for creating seats for parent membership level at checkout.
<?php
/*
Define the global array below for your main accounts and sponsored levels.
Array keys should be the main account level.
*/
global $pmprosm_sponsored_account_levels;
$pmprosm_sponsored_account_levels = array(
//set 3 seats for level 8 at level 2 checkout
2 => array( //id # of parent level
@ipokkel
ipokkel / my_init_change_pmpro_content_filter_priority.php
Last active January 8, 2020 10:18
Tell PMPro to filter the content a bit later (for users not in a specific role) to work with ProfitBuilder plugin #pmpro #profitbuilder #compatibility
<?php // do NOT copy this line, copy from below this line
/*
Tell PMPro to filter the_content a bit later.
This will sometimes fix issues where theme or plugin elements (e.g. videos)
are not being filtered by PMPro. Note that this sometimes will cause
some things (e.g. share links) to be filtered that you don't want to be
filtered... and sometimes edits to the theme or a child theme are
required to get the desired effect.
@ipokkel
ipokkel / rh-example-church.php
Created April 11, 2019 22:05
Register Helper example including user's church fields.
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for my Paid Memberships Pro Setup
Version: .1
Author: Paid Memberships Pro
Author URI: https://www.paidmembershipspro.com
*/