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_filter('app_pre_confirmation_reply', 'select_random_provider'); | |
function select_random_provider($reply_array) | |
{ | |
// Return if worker is already selected | |
if(''!==$reply_array['worker']) | |
return $reply_array; | |
// Read in the $value params from the $_POST request | |
global $appointments; |
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
// Use this Function to test if Membership sends out emails | |
add_filter( 'the_content' , 'wp_mail_test' ); | |
function wp_mail_test( $content ){ | |
// Put the ID of the message you want to send here | |
$c = new M_Communication(1) ; | |
// Put the User ID here, to whom the mail must be sent | |
$c->send_message(1,false,false); | |
return $content; | |
} |
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_filter( 'script_loader_tag', function ( $tag, $handle ) { | |
return preg_replace("/(><\/[a-zA-Z][^0-9](.*)>)$/", " async $1 ", $tag ); | |
}, 10, 2 ); |
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 send_admin_notification($funder_id, $trans = false, $fund) { | |
if($trans != false) { | |
$donor = $trans['first_name'] . ' ' . $trans['last_name']; | |
$donation_amount = $this->format_currency('',$trans['gross'], 1); | |
$donor_email = $trans['payer_email']; | |
$recurring = 'One-Time'; | |
if(isset($trans['cycle'])) { | |
$recurring = $trans['cycle']; |
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( 'wp_ajax_check_empty', 'is_cart_empty' ); | |
add_action( 'wp_ajax_nopriv_check_empty', 'is_cart_empty' ); | |
add_action( 'wp_footer', 'wagon_script' ); | |
function is_cart_empty($content) { | |
global $mp ; | |
$products = $mp -> get_cart_contents() ; | |
if (empty($products)) | |
echo "Empty" ; | |
else |
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 GA_Event_Code($ret) { | |
$script = <<< GACode | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
jQuery( ".appointments-confirmation-button" ).bind( "click", function() { | |
// Update variable names here to match what you previously set. | |
_gaq.push(['_trackEvent', 'Confirmed', 'Click', 'Appointment Confirmed']); | |
}); | |
}); | |
</script> |
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( 'bp_core_signup_user', 'integrate_profile_fields' ) ; | |
function integrate_profile_fields ($user_id, $user_login, $user_password, $user_email, $usermeta) { | |
require_once( MAILCHIMP_PLUGIN_DIR.'mailchimp-sync.php' ); | |
require_once( MAILCHIMP_PLUGIN_DIR.'helpers.php' ); | |
$mailchimp_mailing_list = get_site_option('mailchimp_mailing_list'); | |
$mailchimp_auto_opt_in = get_site_option('mailchimp_auto_opt_in'); |
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_filter ('psts_setting_checkout_url' , 'ssl_url_fix'); | |
function ssl_url_fix( $setting, $default ) { | |
// If permalink does not have http prepended then do it. | |
if (strpos($setting, "http://") !== 0) | |
$setting = "http://". $setting ; | |
return $setting ; | |
} |
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
// Append the Phone Number to the Confirmation / Reminder mails | |
add_filter( 'app_confirmation_message', 'append_phone_to_app_email', 10, 3 ); | |
add_filter( 'app_reminder_message', 'append_phone_to_app_email', 10, 3 ); | |
function append_phone_to_app_email( $msg, $obj, $app_id) { | |
$worker = $obj->worker; | |
// Get Worker Phone from $meta table | |
$worker_phone = get_user_meta($worker, "app_phone", true); | |
if ( $worker_phone ) { | |
// Search and replace the WORKER_CONTACT string |
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
include_once( WP_CONTENT_DIR . '/plugins/blogtemplates/nbt-api.php' ); | |
nbt_load_api(); | |
// Fires when a new blog is created | |
add_action( 'wpmu_new_blog', 'bulk_update_blogs', 99, 2 ); | |
// Hook this function to a good place | |
function bulk_update_blogs( $new_blog_id, $new_user_id ) { | |