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
| // 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
| 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
| 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
| // 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
| 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
| diff --git a/php.sublime-completions b/php.sublime-completions | |
| index 5a8432b..e6990e0 100644 | |
| --- a/php.sublime-completions | |
| +++ b/php.sublime-completions | |
| @@ -2,21 +2,24 @@ | |
| "scope": "source.php comment.block.documentation", | |
| "completions": | |
| [ | |
| + { "trigger" : "Drupal", "contents": "Drupal"}, | |
| { "trigger" : "@api", "contents": ""}, |
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
| { | |
| "bold_folder_labels": true, | |
| "caret_style": "wide", | |
| "default_line_ending": "unix", | |
| "ensure_newline_at_eof_on_save": true, | |
| "fallback_encoding": "UTF-8", | |
| "find_selected_text": true, | |
| "font_options": | |
| [ | |
| "subpixel_antialias" |
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 will log all errors notices and warnings to a file called debug.log in | |
| * wp-content only when WP_DEBUG is true. if Apache does not have write permission, | |
| * you may need to create the file first and set the appropriate permissions (i.e. use 666). | |
| */ | |
| define( 'WP_DEBUG', true ); // Or false | |
| if ( WP_DEBUG ) { | |
| define( 'WP_DEBUG_LOG', true ); | |
| define( 'WP_DEBUG_DISPLAY', 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
| //Build the registration id | |
| function espresso_build_registration_id_custom($event_id){ | |
| remove_filter('filter_hook_espresso_registration_id', 'espresso_build_registration_id', 10, 1); | |
| return uniqid($event_id . '-', true); | |
| } | |
| //Registration id filter | |
| add_filter('filter_hook_espresso_registration_id', 'espresso_build_registration_id_custom', 8, 1); |