Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Template for adding a shortcode page to a plugin. Steps:
1. Include this file.
2. Add [my_page_shortcode] shortcode to a page of the site.
3. Navigate to the page on the front end.
Be sure to change the name of the shortcode and the function names below.
<?php
/*
Plugin Name: PMPro WP Affiliate Platform Integration
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-dev/
Description: Process an affiliate via WP Affiliate Platform after a PMPro checkout.
Version: .3
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
Both Paid Memberships Pro (http://wordpress.org/extend/plugins/paid-memberships-pro/) and WP Affiliate Platform (http://www.tipsandtricks-hq.com/wordpress-affiliate/) must be installed and activated.
@messica
messica / pap_js_footer.php
Created February 18, 2014 17:37
PAP JavaScript Footer
@messica
messica / pmpro_copy_membership_requirements.php
Last active August 4, 2016 19:59
Copy membership post requirements from one level to another.
<?php
/*
* Copy Membership Requirements from one level to another
*
* Instructions:
* 1. Set $copy_from and $copy_to to the level IDs you want
* 2. Visit any page of your site and add "&copy_membership=1" to the address.
*
*/
function pmpro_copy_membership_requirements() {
@messica
messica / my_pmpro_custom_advanced_options.php
Created April 10, 2014 19:46
Add new custom fields to Advanced Settings with an array of options. Supports 'text','select', and 'textarea' as field_types.
<?php
//Add new custom fields to Advanced Settings with an array of options. Supports 'text','select', and 'textarea' as field_types.
//
//Example:
//
function my_advanced_settings() {
$custom_fields = array(
'field1' => array(
'field_name' => 'test1',
@messica
messica / my_wp_nav_menu_objects.php
Last active August 29, 2015 13:59
Hide Menu Items Based on Membership Categories
<?php
/* Hide Menu Items Based on Membership Categories */
function my_wp_nav_menu_objects($sorted_menu_items, $args)
{
global $wpdb;
//only check this theme location
if ($args->theme_location != 'secondary-menu')
return $sorted_menu_items;
@messica
messica / my_pmpro_subscription_payment_failed.php
Created April 25, 2014 14:23
Cancel subscription on billing failure
<?php
// Cancel membership account on billing failure
function my_pmpro_subscription_payment_failed($old_order) {
pmpro_changeMembershipLevel(0, $old_order->user_id);
}
add_action('pmpro_subscription_payment_failed', 'my_pmpro_subscription_payment_failed');
<?php
/*
Plugin Name: PMPro Customizations (Register Helper Example)
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Customizations for Paid Memberships Pro (Register Helper Example)
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
//we have to put everything in a function called on init, so we are sure Register Helper is loaded
@messica
messica / my_pmprorh_init.php
Last active August 29, 2015 14:01 — forked from strangerstudios/pmpro-customizations.php
Register Helper Initialization Example
<?php
/*
Plugin Name: Register Helper Example
Plugin URI: http://www.paidmembershipspro.com/wp/pmpro-customizations/
Description: Register Helper Initialization Example
Version: .1
Author: Stranger Studios
Author URI: http://www.strangerstudios.com
*/
//we have to put everything in a function called on init, so we are sure Register Helper is loaded
@messica
messica / my_pmpro_getresponse_custom_fields.php
Created May 18, 2014 14:05
PMPro GetResponse Custom Fields Example
<?php
/* PMPro GetResponse Custom Fields Example */
function my_pmpro_getresponse_custom_fields() {
$fields = array(
'company' => 'XYZ Company',
'title' => 'CEO'
);