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
jQuery(document).ready( function() { | |
jQuery("#appointment-edit-form-submit").click( function() { | |
// THIS CAUSED THE ERRORS | |
app_email = jQuery(this).attr("app_email") | |
app_phone = jQuery(this).attr("app_phone") | |
jQuery.ajax({ | |
type : "post", | |
dataType : "json", | |
url : localhost://wp-admin/admin-ajax.php?action=save_xprofile, | |
data : {action: "save_xprofile", app_email : app_email, app_phone: app_phone}, |
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_save_xprofile', 'save_appointment_settings_xprofile'); | |
// Handles AJAX calls to the backend. Submit form with save_xprofile as action | |
function save_appointment_settings_xprofile(){ | |
$profileuser = wp_get_current_user(); | |
if ( isset( $_POST['app_email'] ) ) | |
update_user_meta( $profileuser->ID, 'app_email', $_POST['app_email'] ); | |
if ( isset( $_POST['app_phone'] ) ) | |
update_user_meta( $profileuser->ID, 'app_phone', $_POST['app_phone'] ); | |
// Get other variables like location from $_POST from here, if extending |
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
# Get Membership Activity during a specified period | |
SELECT * FROM wp_m_membership_news | |
WHERE newsdate | |
BETWEEN '2014-12-30 00:00:01' # Put start date here | |
AND '2014-12-31 23:59:59' # Put end date here | |
# Members who successfully paid during a specified period | |
SELECT wp_users.ID, user_email, user_login, display_name, paymentmade, paymentexpires |
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('register_user','mailchimp_add_to_list') | |
function mailchimp_add_to_list ($user_id) | |
{ | |
// Get Full Name and Email from BuddyPress | |
$name = bp_core_get_user_displayname( $user_id ); | |
$email = bp_core_get_user_email($user_id); |
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
private function add_hooks () { | |
// Modify here if changing contact form | |
add_action('wpcf7_mail_sent',array($this,'integrate_affiliate_code',)); | |
} | |
private function integrate_affiliate_code () { | |
// Use a jsonHandler to manually add 5 Pounds to the affiliate | |
$jsonHandler = new WPAM_Util_JsonHandler; | |
// Modify here if you want to increase payouts or switch affiliate plugins | |
$jsonHandler->addTransaction($affiliate, 'credit',5, "Consultation Referral"); |
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 the 4th Option to the array | |
function get_classes() { | |
return apply_filters( 'app_box_class_names', | |
array( | |
'free' => __('Free', 'appointments'), | |
'busy' => __('Busy', 'appointments'), | |
'notpossible' => __('Not possible', 'appointments'), | |
// Add the option and description here | |
'free_but_collision' => __(‘Free, but Collision', '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
// Function to get a list of users based on date joined / subscription type / level etc and refire pings | |
function refire_pings() | |
{ | |
global $wpdb; | |
// The query string ( see below for more examples ) | |
$query = "SELECT `ID` , `sub_id` , `level_id`, `user_email` , `user_login` , `display_name` | |
FROM `wp_m_membership_relationships` | |
INNER JOIN `wp_users` ON `wp_m_membership_relationships.user_id` = `wp_users.ID` | |
WHERE `startdate` |
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
// Once the appointment is confirmed, then process the myCreds. | |
add_filter('app_post_confirmation_status', 'confirm_manual_payments',10,5); | |
function confirm_manual_payments($status, $price, $service, $worker, $user_id) { | |
if("pending" === $status || "confirmed" === $status) : | |
global $wp, $current_user; | |
$mycred = mycred(); | |
$current_user = wp_get_current_user(); | |
$balance = round($mycred->get_users_balance( $current_user->ID )); | |
if ( $balance > 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( 'membership_expire_subscription', 'notify_expiry', 10, 2 ); | |
function notify_expiry( $sub_id, $user_id ) { | |
$user = get_userdata($user_id); | |
// You can also filter only specific subscriptions here | |
$sub = Membership_Plugin::factory()->get_subscription( $sub_id ); | |
// Put your email here | |
$to = '[email protected]' ; | |
$subject = "Membership Expiry" ; | |
// Format email content if needed | |
$message = sprintf(__( '<strong>%s</strong> has left subscription <strong>%s</strong>','membership' ), $user->display_name, $sub->sub_name() ); |
OlderNewer