Skip to content

Instantly share code, notes, and snippets.

Avatar

Travis Lima travislima

View GitHub Profile
@travislima
travislima / pmpro-customizations.php
Last active Aug 19, 2021
PMPro-extra-expiration-warning-emails (Change day email is sent out)
View pmpro-customizations.php
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for Paid Memberships Pro
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@travislima
travislima / pmpro-grace-period.php
Last active Apr 3, 2021
Add a "Grace Period" to a Paid Memberships Pro Membership (After expiration date is met).
View pmpro-grace-period.php
<?php
/*
* The Code Recipe will add a 15-day grace period to a members membership once the membership expires.
* Add this Code Recipe to a PMPro Customization Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* For more information on Paid Memberships Pro - www.paidmembershipspro.com
*/
function my_pmpro_membership_post_membership_expiry( $user_id, $level_id ) {
// Make sure we aren't already in a grace period for this level
$grace_level = get_user_meta( $user_id, 'grace_level', true );
@travislima
travislima / pmpro-hide-tos-freelevel.php
Created Jun 1, 2016
PMPro - Hide TOS Page for Free Level
View pmpro-hide-tos-freelevel.php
<?php
//copy lines 4 - 14 into your theme's functions.php or custom plugin
function my_option_pmpro_tospage( $option ){
global $pmpro_level;
//hide the TOS link if free level
if( pmpro_isLevelFree($pmpro_level) ){
$option = false;
}
@travislima
travislima / account.php
Created Jun 8, 2016
pmpro account page change invoices to orders
View account.php
<?php
/*
custom page template for account.php add entire document to your custom account.php template
*/
function pmpro_shortcode_account_custom($atts, $content=null, $code="")
{
global $wpdb, $pmpro_msg, $pmpro_msgt, $pmpro_levels, $current_user, $levels;
// $atts ::= array of attributes
// $content ::= text within enclosing form of shortcode element
@travislima
travislima / remove-expire-membership-text.php
Created Jun 23, 2016
pmpro-set-description-addon-remove-membership-expires-on-text
View remove-expire-membership-text.php
<?php
/*
Plugin Name: Paid Memberships Pro - Set Expiration Dates Add On
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-set-expiration-dates/
Description: Set a specific expiration date (e.g. 2013-12-31) for a PMPro membership level or discount code.
Version: .2
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
@travislima
travislima / rh-telephone.php
Created Aug 2, 2016
Adding telephone field using Register Helper
View rh-telephone.php
<?php
//copy from line 5 downwards into your customization plugin
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
if(!function_exists("pmprorh_add_registration_field"))
{
return false;
@travislima
travislima / rh-bill-to-company.php
Last active Aug 5, 2016
PMPRo register helper add a Bill To Company Field
View rh-bill-to-company.php
<?php
//copy from line 5 downwards into your customization plugin
function my_pmprorh_init()
{
//don't break if Register Helper is not loaded
if(!function_exists("pmprorh_add_registration_field"))
{
return false;
@travislima
travislima / pmpro_jpn_yen_move_left.php
Created Aug 8, 2016
Move the JPN Yen currency to the left in PMPro
View pmpro_jpn_yen_move_left.php
<?php
/* Move the Japanese Yen currency to the left
Add to your PMPro Customizations plugin */
function custom_yen($pmpro_currencies) {
$pmpro_currencies['JPY']['position'] = 'left';
return $pmpro_currencies;
}
add_filter( 'pmpro_currencies', 'custom_yen' );
@travislima
travislima / wpgm-radius-distance-default-change.php
Created Oct 20, 2016
WP Google Maps - Change default radius distance
View wpgm-radius-distance-default-change.php
<?php
/*This is the original piece of code that you will need to change. You can find this code in the wp-google-maps-pro.php file (Approx line: 7193)
$ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"1\">".__("1km","wp-google-maps")."</option>";
$ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"5\">".__("5km","wp-google-maps")."</option>";
$ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"10\" selected>".__("10km","wp-google-maps")."</option>";
$ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"25\">".__("25km","wp-google-maps")."</option>";
$ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"50\">".__("50km","wp-google-maps")."</option>";
$ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"75\">".__("75km","wp-google-maps")."</option>";
@travislima
travislima / charge_members_all_access.php
Created Nov 19, 2016
Charge All access members for Packages if specific category is found even if their membership has access
View charge_members_all_access.php
/*
This gist is a modification of the "All Access" gist found here:
https://www.paidmembershipspro.com/allow-specific-membership-levels-to-view-addon-packages-and-require-others-to-pay/
This gist will allow you to add a specific category to any post.
This will in turn require users to pay for the post even if they have all access permissions.
Set levels as "all access levels" so members of these levels will be able to view all Addon Packages.
Requires Paid Memberships Pro and the pmpro-addon-packages plugin.
*/