This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action("mepr-upgraded-recurring-sub", "upgraded_recurring_sub"); | |
function upgraded_recurring_sub( $sub ) { ... } | |
add_action("mepr-upgraded-single-sub", "upgraded_single_sub"); | |
function upgraded_single_sub( $txn ) { ... } | |
add_action("mepr-upgraded-sub", "upgraded_sub"); | |
function upgraded_sub( $type, $sub ) { if( $type==='single' ) { /* sub is a txn */ } else { /* sub is a sub */ } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$my_affiliate_url = 'http://example.com?aff=123'; | |
$download_qr_code = false; | |
$pretty_link_id = prli_create_pretty_link( $my_affiliate_url ); | |
if(!$pretty_link_id) { | |
header('HTTP/1.1 404 Not Found'); | |
exit; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: MemberPress Products to User Roles | |
Plugin URI: http://memberpress.com | |
Description: Assigns a member to a User Role depending on what Product they purchased. | |
Version: 1.0.0 | |
Author: Caseproof, LLC | |
Author URI: http://caseproof.com | |
Copyright: 2004-2013, Caseproof, LLC | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$user = MeprUtils::get_currentuserinfo(); | |
// Alternatively you can just create a user from a user id directly | |
// $user = new MeprUser($user_id); | |
if( $user ) { | |
$active_product_ids = $user->active_product_subscriptions(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Returns true if a specified user is active for a specified product ... false if the user isn't active */ | |
function is_user_active_for_product( $user_id, $product_id ) { | |
global $wpdb; | |
$mepr_db = new MeprDb(); | |
$sql = "SELECT COUNT(*) " . | |
"FROM {$mepr_db->transactions} " . | |
"WHERE user_id=%d " . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(is_plugin_active('memberpress/memberpress.php')) { | |
add_action( 'user_register', 'mp_auto_enroll' ); | |
//add_action( 'gform_user_registered', 'mp_auto_enroll', 10, 4 ); | |
function mp_auto_enroll($user_id, $user_config=array(), $entry='', $user_pass='') { | |
$txn = new MeprTransaction(); | |
$txn->user_id = $user_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git commands executed within git working dir | |
git commit -am "Bump to 1.5.0" | |
git push origin master | |
git tag 1.5.0 | |
git push origin tag 1.5.0 | |
cd /path/to/svn/working/dir |