Skip to content

Instantly share code, notes, and snippets.

View ipokkel's full-sized avatar

Theuns Coetzee ipokkel

View GitHub Profile
<?php // Do not copy this tag
// Use unique membership key combined with the email address as username with PMPro checkout. You'll also have to hide the username fields at checkout using CSS or a custom checkout page template.
// Paste the code below into a PMPro Customization Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
function my_init_unique_key_and_email_as_username()
{
$args = array(
'role' => 'author', // authors only
'orderby' => 'registered', // registered date
'order' => 'DESC', // last registered goes first
@ipokkel
ipokkel / my_init_unique_key_as_username.php
Created March 1, 2019 12:45
Use unique membership key as username with PMPro checkout
<?php // Do not copy this tag
// Use unique membership key as username with PMPro checkout. You'll also have to hide the username fields at checkout using CSS or a custom checkout page template.
// Paste the code below into a PMPro Customization Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
function my_init_unique_key_as_username()
{
$args = array(
'role' => 'author', // authors only
'orderby' => 'registered', // registered date
@ipokkel
ipokkel / my_init_unique_key_as_username.php
Last active March 4, 2019 08:56
Use unique membership key as username with PMPro checkout.
<?php // Do not copy this tag
// Use unique membership key as username with PMPro checkout. You'll also have to hide the username fields at checkout using CSS or a custom checkout page template.
// Paste the code below into a PMPro Customization Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
function salted_md5($encrypt_string) {
// If no string is passed create one from timestamp
if ( !$encrypt_string )
$encrypt_string = rand(10000,99999);
@ipokkel
ipokkel / pmpro-customizations-register-helper-example.php
Last active March 4, 2019 10:10
Paid Memberships Pro Register Helper: Add t-shirt sizes as selection
<?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 / pmpro-customizations-register-helper-example.php
Created March 4, 2019 10:13
Paid Memberships Pro Register Helper: Add license number and full name
<?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 / pmpro-customizations-register-helper-example.php
Last active March 6, 2019 07:38
Paid Memberships Pro Register Helper: Add t-shirt sizes as selection
<?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 / pmpro-customizations-rh-state-city-phone.php
Created March 13, 2019 08:37
Example for adding State, City and Phone number fields using the PMPro Customizations plugin
<?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 / load-my-script-pmpro.php
Created March 13, 2019 12:53 — forked from andrewlimaza/load-my-script-pmpro.php
Load content on confirmation or checkout page for PMPro.
<?php
/**
* Load content for specific pages, checkout or confirmation page
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function load_my_script_for_pmpro() {
global $pmpro_pages;
if ( is_page( $pmpro_pages['checkout'] ) || is_page( $pmpro_pages['confirmation'] ) ) {
@ipokkel
ipokkel / pmro-customization-login-url-example.php
Created March 13, 2019 13:26
Change login url in WordPress emails.
<?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
*/
//Now start placing your customization code below this line
@ipokkel
ipokkel / pmpro-customizations_add_member_billing_shipping.php
Last active November 14, 2023 10:42
Paid Memberships Pro Customization add billing and shipping fields to Add Member from Admin
<?php
/**
* Add Billing Address fields to the User Profile Edit page(s) and Add Member page.
*
* 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.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function show_pmpro_billing_address_fields_on_add_member() {