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
| /* | |
| This is an update to the function in uploads/espresso/custom_shortcodes.php | |
| */ | |
| function show_cat_event_date_max($atts) { | |
| extract(shortcode_atts(array('max_days' => 'No Date Supplied', | |
| 'event_category_id' => __('No Category ID Supplied','event_espresso'), | |
| 'show_deleted' => false), $atts)); | |
| $max_days = "{$max_days}"; | |
| $event_category_id = "{$event_category_id}"; | |
| $show_deleted = $show_deleted == "true" ? true : 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
| function email_by_session_id_custom ($session_id, $send_attendee_email = TRUE, $send_admin_email = TRUE, $multi_reg = FALSE) { | |
| global $wpdb; | |
| $sql = "SELECT id FROM " . EVENTS_ATTENDEE_TABLE . " WHERE attendee_session = %s"; | |
| $attendees = $wpdb->get_col( $wpdb->prepare( $sql, $session_id )); | |
| $admin_email_params = array('email_body'=>''); | |
| foreach ($attendees as $attendee_id) { | |
| $data = espresso_prepare_email_data($attendee_id, $multi_reg); | |
| if ($send_attendee_email == 'true') { | |
| $attendee_email_params = espresso_prepare_email($data); | |
| event_espresso_send_email($attendee_email_params); |
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 my_payment_link_display_function() { | |
| echo '<a href="https://square.com"><img src="http://square_logo.gif"></a>'; | |
| } | |
| add_action('action_hook_espresso_display_offsite_payment_gateway', 'my_payment_link_display_function'); |
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 event_espresso_send_payment_notification($atts) { | |
| do_action('action_hook_espresso_log', __FILE__, __FUNCTION__, ''); | |
| global $org_options; | |
| extract($atts); | |
| if ($org_options['default_mail'] == 'Y') { | |
| event_espresso_email_confirmations(array('attendee_id' => $attendee_id, 'send_admin_email' => 'false', 'send_attendee_email' => 'true', 'custom_data' => array('email_type' => 'payment', 'payment_subject' => $org_options['payment_subject'], 'payment_message' => $org_options['payment_message']))); | |
| } |
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
| // replaces line 24 of gateways/paypal/paypal_ipn.php | |
| if (empty($_POST['ipn_track_id']) && ($_POST['payment_status'] == 'Completed' || $_POST['payment_status'] == 'Pending')) { | |
| $payment_data['txn_details'] = serialize($_POST); | |
| $payment_data['txn_id'] = $_POST['txn_id']; | |
| $payment_data['payment_status'] = 'Pending'; | |
| } elseif ($myPaypal->validateIpn()) { | |
| // replaces line 12 on gateways/paypal/init.php, to add the second line in | |
| add_filter('filter_hook_espresso_transactions_get_payment_data', 'espresso_process_paypal'); | |
| add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_paypal'); |
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
| // substitute for lines 25-30 in my_events_page.php | |
| while(list($key,$value)=each($_POST['checkbox'])): | |
| $data = espresso_prepare_email_data($key, FALSE); | |
| event_espresso_send_email(array( | |
| 'send_to' => $data->event->alt_email == '' ? $org_options['contact_email'] : $data->event->alt_email . ',' . $org_options['contact_email'], | |
| 'email_subject' => $data->event->event_name . ' ' . __('registration cancellation', 'event_espresso'), | |
| 'email_body' => $data->attendee->email . " | " . $data->attendee->lname . ", " . $data->attendee->fname . "<br>" | |
| . "has cancelled for event:<br>" | |
| . stripslashes_deep($data->event->event_name) . " | " . $data->attendee->price_option . "<br>" | |
| . event_date_display($data->attendee->start_date) . ' - ' . event_date_display($data->attendee->end_date) . "<br>" |
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 | |
| function get_event_date_times($event_id = FALSE, $format = ARRAY_A) { | |
| global $wpdb; | |
| $sql = "SELECT e.start_date, e.end_date, ese.start_time, ese.end_time "; | |
| $sql .= "FROM " . EVENTS_DETAIL_TABLE . " e "; | |
| $sql .= "LEFT JOIN " . EVENTS_START_END_TABLE . " ese ON ese.event_id = e.id "; | |
| $sql .= "WHERE e.id = %d"; | |
| $results = $wpdb->get_results($wpdb->prepare($sql, $event_id), $format); | |
| return $results; | |
| } |
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
| // THIS IS FOR 2.1 BETA | |
| // in the espresso calendar object add.. | |
| /** | |
| * @var INT $_event_user_id | |
| * @access private | |
| */ | |
| private $_event_user_id = 0; | |
| // in public function espresso_calendar( $atts ) { | |
| $atts = shortcode_atts( $defaults, $atts ); |
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 | |
| function espresso_get_total_cost_custom($payment_data) { | |
| remove_filter('filter_hook_espresso_get_total_cost', 'espresso_get_total_cost'); | |
| global $wpdb; | |
| //if for some reason attendee_session isn't setin the payment data, set it now | |
| if(!array_key_exists('attendee_session',$payment_data) || empty($payment_data['attendee_session'])){ | |
| $SQL = "SELECT attendee_session FROM " . EVENTS_ATTENDEE_TABLE . " WHERE id=%d"; | |
| $session_id = $wpdb->get_var( $wpdb->prepare( $SQL, $payment_data['attendee_id'] )); | |
| $payment_data['attendee_session']=$session_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
| add_action('action_hook_espresso_save_attendee_data','espresso_create_wp_user', 10, 1); | |
| function espresso_create_wp_user($attendee_data) { | |
| if( username_exists( $attendee_data['email'] ) == NULL ) { | |
| global $org_options, $wpdb; | |
| // Generate the password and create the user | |
| $password = wp_generate_password( 12, false ); | |
| $user_id = wp_create_user( $attendee_data['email'], $password, $attendee_data['email'] ); | |
| // Set the users details |