Skip to content

Instantly share code, notes, and snippets.

Avatar

David Parker dparker1005

  • Stranger Studios
View GitHub Profile
@dparker1005
dparker1005 / pmpro_next_billing_date_customization.php
Last active Sep 22, 2018
Adds the next billing date for a recurring membership to the Members List page of Paid Memberships Pro and the CSV file generated by it.
View pmpro_next_billing_date_customization.php
<?php
/*
* To add 'Next Billing Date' to Members List
*/
//Add 'Next Billing Date' Column to Members List Header
function my_pmpro_memberslist_extra_cols_header($theusers)
{
?>
<th><?php _e('Next Billing Date', 'pmpro');?></th>
<?php
@dparker1005
dparker1005 / pmpro_discount_on_members_list.php
Created Jun 26, 2017
Adds the discount code ID and Name to the Members List page of Paid Memberships Pro
View pmpro_discount_on_members_list.php
<?php
//To add Discount Code Information to Members List
//Add Discount Code Information Column to Members List Header
function my_pmpro_memberslist_extra_cols_header($theusers)
{
?>
<th><?php _e('Discount ID', 'pmpro');?></th>
<th><?php _e('Discount Code', 'pmpro');?></th>
<?php
}
@dparker1005
dparker1005 / pmpro_hide_account_page_until_validated_customization.php
Last active Jul 10, 2020
Prevent users from seeing their PMPro account page until they confirm their email while using the PMPro Email Confirmation Add On.
View pmpro_hide_account_page_until_validated_customization.php
<?php
// Copy from below here...
/*
* Prevent users from seeing their PMPro account page until they confirm
* their email while using the PMPro Email Confirmation Add On.
*
* 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.
@dparker1005
dparker1005 / pmpro_remove_now_customization.php
Created Jun 29, 2017
Removes the word "now" from the cost text in Paid Memberships Pro
View pmpro_remove_now_customization.php
function pmpro_remove_now($cost)
{
$cost = str_replace(" now", "", $cost);
return $cost;
}
add_filter("pmpro_level_cost_text", "pmpro_remove_now", 10, 4);
@dparker1005
dparker1005 / pmpro_import_membership_enddate_customization.php
Last active Jul 14, 2017
Adds the 'import membership enddate' field to the Members List page of Paid Memberships Pro and the CSV file generated by it.
View pmpro_import_membership_enddate_customization.php
<?php
// To use this code, add it to a PMPro Customizations Plugin
// https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
//
// To add 'Import Membership Enddate' to Members List
//
//Add 'Import Membership Enddate' Column to Members List Header
@dparker1005
dparker1005 / pmpro_redirect.php
Created Aug 22, 2017
Redirects non-users from blog to levels page in PMPro
View pmpro_redirect.php
/*
Redirect away from certain URLs with PMPro.
Be careful, the code will redirect any URL *containing* the strings in the $urls array.
So e.g., if /not-locked/about/ is public and you have /about/ in the list, it will still be locked down to non-members.
*/
function pmpro_hide_urls()
{
//make sure PMPro is activated
if(!function_exists('pmpro_hasMembershipLevel'))
return;
@dparker1005
dparker1005 / pmproarc_pmpro_custom_autorenewal_checkbox_text.php
Last active Aug 24, 2017
Changes the text that shows next to the Automatic Renewals checkbox. To edit text, change "NEW TEXT HERE" in the code and insert into a PMPro customizations plugin.
View pmproarc_pmpro_custom_autorenewal_checkbox_text.php
<?php
add_filter( 'gettext', 'change_auto_renewal_checkbox_text', 20, 3 );
/**
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function change_auto_renewal_checkbox_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Yes, renew at %s' :
$translated_text = __( 'NEW TEXT HERE', 'pmpro' );
break;
@dparker1005
dparker1005 / facebook_email_on_checkout.php
Last active Jul 12, 2018
Add Facebook Email Field on Checkout
View facebook_email_on_checkout.php
<?php
//Add from here down to the bottom of your PMProcustomizations plugin
function my_pmprorh_init() {
// don't break if Register Helper is not loaded.
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
View advanced_facebook_email_on_checkout.php
<?php
//Add from here down to the bottom of your PMProcustomizations plugin
function my_pmprorh_init() {
// don't break if Register Helper is not loaded.
if ( ! function_exists( 'pmprorh_add_registration_field' ) ) {
return false;
}
@dparker1005
dparker1005 / members_list_international_address_customization.php
Last active Jul 19, 2018
Formats address in Members List page for international addresses (i.e. Zip City) without looking at the State field
View members_list_international_address_customization.php
<?php
//Add from here down to the bottom of your PMPro Customizations plugin
add_action('pmpro_formatted_address', 'pmpro_custom_members_list_address', 10, 9);
function pmpro_custom_members_list_address( $address, $name, $address1, $address2, $city, $state, $zip, $country, $phone ) {
$address = '';
if ( ! empty( $name ) ) {
$address .= $name . '<br/>';