Skip to content

Instantly share code, notes, and snippets.

Avatar

Jarryd Long JarrydLong

View GitHub Profile
@JarrydLong
JarrydLong / pmpro-redirect-non-members.php
Last active May 10, 2021 — forked from strangerstudios/pmpro-redirect-non-members.php
Paid Memberships Pro Redirect Non-members to Login/Homepage
View pmpro-redirect-non-members.php
<?php //Do not copy
/*
Redirect to login or homepage if user is logged out or not a member
Add this code to your active theme's functions.php file.
*/
function my_template_redirect()
{
global $current_user;
if( !function_exists( 'pmpro_login_url' ) ){
View mypmpro-update-user-countries.php
<?php
/**
* This will update all member's billing country to Germany.
*
* Exercise caution when making these changes. They cannot be undone. Make a backup of your database
* before running this script.
*
* Enter /wp-admin/?updateusercountry=true in your URL to run the script.
*
*
@JarrydLong
JarrydLong / pmpro-customizations.php
Last active May 4, 2021 — forked from strangerstudios/pmpro-customizations.php
Tax solution for British Columbia, Canada to be used with Paid Memberships Pro
View pmpro-customizations.php
<?php
/*
Plugin Name: PMPro Customizations
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for PMPro
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
/*
View mypmpro-remove-all-paypal-members.php
<?php
/**
* This will remove all members who have an active membership and have bought through PayPal
* or PayPal Express
*
* Exercise caution when making these changes. They cannot be undone. Make a backup of your database
* before running this script.
*
* Enter /wp-admin/?removepaypal=true in your URL to run the script.
*
View mypmpro-member-directory-search-shortcode.php
<?php
/**
* This recipe will create the [pmpro_member_search] shortcode, allowing to you to search
* your member directory.
*
*
* 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/
View pacific-plugins-2checkout-label.php
<?php
/**
* This code snippet with override the 2Checkout label.
*
* This snippet can be added to either your theme's functions.php file
* or by the use of a Code Snippet plugin.
*/
function pacificplugins_2checkout_label( $label ){
return 'Debit/Credit Cards';
@JarrydLong
JarrydLong / my-pmpro-directory-widget-any-page.php
Last active Apr 12, 2021 — forked from dparker1005/My_PMPro_Directory_Widget.php
Add widget to Member Directory page to filter results.
View my-pmpro-directory-widget-any-page.php
<?php
/**
* Plugin Name: My PMPro Directory Widget
* Description: Add widget to Member Directory page to filter results.
*/
class My_PMPro_Directory_Widget extends WP_Widget {
/**
* Sets up the widget
*/
View mypmpro-send-shipping-fields-mailchimp.php
<?php
/**
* This recipe will send shipping fields to Mailchimp
*
*
* 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/
@JarrydLong
JarrydLong / pmpro_checkout_level_custom_prorating_rules.php
Created Apr 9, 2021 — forked from ideadude/pmpro_checkout_level_custom_prorating_rules.php
Override the default proration behavior in the PMPro Proration Add On
View pmpro_checkout_level_custom_prorating_rules.php
/*
1. Make sure PMPro and PMPro Proration are both active.
2. Edit the pmpro_checkout_level_custom_prorating_rules function below to your needs.
3. Then add this code into a custom plugin for your site.
*/
/**
* Swap in our custom prorating function.
*/
function init_custom_prorating_rules() {
View mypmpro-membership-checkout-image.php
<?php
/**
* This code recipe will create a shortcode that returns an image based on the level selected.
*
* 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/
*
*/