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
| global $wpdb; | |
| $cat_id = 7; | |
| $event_ids = array( 1, 2, 3, 4, 5); | |
| foreach ($event_ids as $event_id) { | |
| $wpdb->insert( | |
| 'wp_term_relationships', | |
| array( | |
| 'object_id' => $event_id, | |
| 'term_taxonomy_id' => $cat_id, | |
| 'term_order' => 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
| // find the first chunk, which should be lines 241-262 of includes/event-management/csv_import.php | |
| // and add the second chunk after. You'll need to add the column to the events.csv file. | |
| //Add category data | |
| $category_names = explode("|", $strings[25]); | |
| foreach ($category_names as $category_name) { | |
| $category_name = trim($category_name); | |
| $category_sql = "SELECT cd.id FROM " . EVENTS_CATEGORY_TABLE . " cd WHERE category_name='%s'"; | |
| $cat_id = $wpdb->get_var($wpdb->prepare($category_sql, $category_name)); |
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', 'apply_volume_discount_hook_function'); | |
| function apply_volume_discount_hook_function ( $attendee_data ) { | |
| if ( !empty($attendee_data['event_meta']['VD_threshold']) && | |
| !empty($attendee_data['event_meta']['VD_discount']) && | |
| (int)$attendee_data['quantity'] >= (int)$attendee_data['event_meta']['VD_threshold'] ) { | |
| global $wpdb; | |
| $data = array( | |
| 'final_price' => max(array( 0, (float)$attendee_data['final_price'] - (float)$attendee_data['event_meta']['VD_discount'] )) | |
| ); |
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 ( 'the_content', 'who_cares_about_an_oxford_comma', 11 ); | |
| function who_cares_about_an_oxford_comma ( $content ) { | |
| $base = '#(<span.*)\{comma}(.*</span>)#'; | |
| $replace = '$1,$2'; | |
| $new_content = ""; | |
| while (($new_content = preg_replace( $base, $replace, $content )) != $content) { | |
| $content = $new_content; | |
| } | |
| return $new_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
| // In plugins/espresso-custom-templates/templates/events-table/index.php on line 20, change it to: | |
| <pre><p class="category-filter" style="display:none"><label><?php echo __('Filter by category ', 'event_espresso'); ?></label></pre> | |
| // and at line 91 insert the code: | |
| if ( !empty( $event->category_id ) ) { | |
| $array_cat=explode(",",$event->category_id); | |
| if (array_search(1,$array_cat)===FALSE) continue; | |
| $cat=array_map(function($val) { return "cat-" . trim($val); }, $array_cat); | |
| $cat_class = implode(" ", $cat); | |
| } else { | |
| continue; |
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('#spco-go-to-step-payment_options-btn').click(function() { | |
| if (jQuery('.reg-page-payment-option-dv').length == 1) { | |
| setTimeout(function(){jQuery('.reg-page-payment-option-dv').click();}, 2000); | |
| } | |
| }); | |
| }); |
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 csv_import() { ?> | |
| <h3>Event Import</h3> | |
| <ul> | |
| <li> | |
| <p><?php _e('This page is for importing your events from a comma separated file (CSV) directly into the the events database. The limitation of this upload is that it does not support the extra questions, only the core event configuration.', 'event_espresso'); ?> </p> | |
| <ul> | |
| <li><?php _e('Please use Y where you want to say Yes and N where you want No.', 'event_espresso'); ?></li> | |
| <li><?php _e('Dates should be formatted YYYY-MM-DD (2009-07-04).', 'event_espresso'); ?></li> |
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 espresso_list_of_event_dates( $EVT_ID = FALSE, $dt_frmt = '', $tm_frmt = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE ) { | |
| $dt_frmt = ! empty( $dt_frmt ) ? $dt_frmt : get_option('date_format'); | |
| $tm_frmt = ! empty( $tm_frmt ) ? $tm_frmt : get_option('time_format'); | |
| $datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID ,$show_expired ); | |
| //d( $datetimes ); | |
| if ( is_array( $datetimes ) && ! empty( $datetimes )) { | |
| global $post; | |
| $html = $format ? '<ul id="ee-event-datetimes-ul-' . $post->ID . '" class="ee-event-datetimes-ul">' : ''; | |
| foreach ( $datetimes as $datetime ) { | |
| if ( $datetime instanceof EE_Datetime ) { |
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 Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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 lines 87-93 | |
| if ($event_status == 'NOT_ACTIVE') { | |
| $live_button = __('Closed', 'event_espresso'); | |
| $cart_link = ''; | |
| } | |
| if ( !empty( $event->category_id ) ) { | |
| $array_cat=explode(",",$event->category_id); | |
| $cat=array_map(function($val) { return "cat-" . trim($val); }, $array_cat); | |
| $cat_class = implode(" ", $cat); |