This file contains hidden or 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
/** | |
* Performs check before saving/inserting products | |
*/ | |
function grouped_product_check($post_id, $post_data) { | |
// If this is just a revision, don't do anything. | |
if (wp_is_post_revision($post_id)) | |
return; | |
if ($post_data['post_type'] == 'product') { | |
if( $post_data['post_parent'] != 0 ) { |
This file contains hidden or 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
add_action('after_setup_theme', 'remove_admin_bar'); | |
function remove_admin_bar() { | |
if (current_user_can('subscriber')) { | |
show_admin_bar(false); | |
} | |
} |
This file contains hidden or 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 | |
//Capture a new member signup. Only ever triggers once for each new member. | |
//Does not trigger for exising members who have subscribed to a Membership before. | |
// | |
//The user may not be logged in when this is called | |
//as it is triggered when a user is added over the REST API, | |
//and also when a user is added from the dashboard (MemberPress -> Members -> Add New) | |
function mepr_capture_new_member_signup_completed($event) { | |
$user = $event->get_data(); | |
$txn_data = json_decode($event->args); |
This file contains hidden or 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 | |
// This loops through the current user's Active Transactions | |
// If one or more of the Transactions belongs to a Parent Corporate Account | |
// Then it's URL to the "Manage Sub Accounts" link will be output on the page. | |
$user = MeprUtils::get_currentuserinfo(); | |
if($user !== false) { | |
$transactions = $user->active_product_subscriptions('transactions'); | |
if(!empty($transactions)) { |
This file contains hidden or 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 | |
// allow for verification to be required for free trial users. | |
function mepr_newuser_approve_override($user_id) { | |
$auto_approve = array(970688, 970684, 970687, 970686, 970685); //An array of product ID's to auto approve | |
if(!class_exists('MeprOptions')) { return; } | |
if(!isset($_POST['mepr_product_id']) && !isset($_POST['manage_sub_accounts_form'])) { return $user_id; } //Not a MemberPress signup? | |
$product_id = isset($_POST['mepr_product_id'])?$_POST['mepr_product_id']:false; |
This file contains hidden or 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(); | |
$sub_user_ids = array(); | |
if($user !== false) { | |
$transactions = $user->active_product_subscriptions('transactions'); | |
if(!empty($transactions)) { | |
foreach($transactions as $txn) { | |
if(($sub = $txn->subscription()) !== false) { |
This file contains hidden or 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
location /map-front-end/ { | |
if (!-e $request_filename){ | |
rewrite ^/maptiles/(.*\.(png|gif))$ /drawtile.php?tile=$1 break; | |
} | |
} |
This file contains hidden or 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
$.each($('a'), function() { | |
alt = this.href.replace(/\/$/, "") | |
$(this).attr('alt', alt.substring(alt.lastIndexOf('/') + 1).replace(/-/g, " ")); | |
}); | |
$.each($('img'), function() { | |
alt = this.href.replace(/\/$/, "") | |
$(this).attr('alt', alt.substring(alt.lastIndexOf('/') + 1).replace(/-/g, " ")); | |
}); |
This file contains hidden or 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
function emailPreviousMonthReportTo($To) | |
{ | |
global $wpdb; | |
//Get Last Months Report | |
$arrResult = $wpdb->get_results("SELECT `id`, | |
`date`, | |
`first_name`, | |
`last_name`, | |
`email`, |
NewerOlder