Skip to content

Instantly share code, notes, and snippets.

Avatar

Theuns Coetzee ipokkel

View GitHub Profile
@ipokkel
ipokkel / rh_fields_example.php
Created Mar 25, 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
View add-billing-to-add-member-and-profile.php
<?php
/*
* Add this code below to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* This will add billing fields to Add Member and the user's profile page.
*/
function add_billing_fields_to_add_member_profile() {
//check for register helper
if(!function_exists("pmprorh_add_registration_field"))
return;
@ipokkel
ipokkel / my_pmprorh_init_with_geopicker.php
Created Mar 26, 2019 — forked from strangerstudios/my_pmprorh_init_with_geopicker.php
PMPro Register Helper Example to Embed MyGeoPosition.com GeoPicker
View my_pmprorh_init_with_geopicker.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 / rh_example_location.php
Created Mar 26, 2019 — 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.
View rh_example_location.php
<?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 Feb 24, 2020
Register helper example to make a dependant field required
View pmpro-customizations-depends-required-example.php
<?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 Apr 2, 2019
Randomize user names for Paid Memberships Pro Member Directory and sort members according to level id or level name
View pmpro_member_directory_sql.php
<?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 Tell PMPro to filter the content a bit later to work with ProfitBuilder plugin
View my_init_change_pmpro_content_filter_priority.php
<?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
Created Apr 8, 2019
Sample for creating seats for parent membership level at checkout.
View pmprosm-sponsor-level-example.php
<?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
*/
@ipokkel
ipokkel / my_init_change_pmpro_content_filter_priority.php
Last active Jan 8, 2020
Tell PMPro to filter the content a bit later (for users not in a specific role) to work with ProfitBuilder plugin #pmpro #profitbuilder #compatibility
View my_init_change_pmpro_content_filter_priority.php
<?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 Apr 11, 2019
Register Helper example including user's church fields.
View rh-example-church.php
<?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
*/
You can’t perform that action at this time.