Forum Replies Created
-
AuthorPosts
-
GDPR20191021Participant
Hi Brian,
I’m sorry, I found the mistake! The “recurring” filter was enabled.
But what’s strange is that when I removed the “recurring” filter by clicking the X-button it disappeared but reappeared after clicking “Published”,”Drafts” or “Trash” in the list. Pushing the “Clear”-button forced all filters to reset and the problem was gone. Maybe there is a little bug!?Thanks a lot and sorry for the inconvenience!
GDPR20191021ParticipantHi Brian,
thanks for your assistance.
I’ve tried the solutions in your conflicts guide:
1. I used already Twenty Fifteen template
2. Disabled all the plugins except the Events Calendar
3. Cleared my browser cache
Nothing works.GDPR20191021ParticipantHi folks,
for those who payed for and nevertheless didn’t get a valuable help, here is my solution:
Connect to your DB, open the options table (the name should be something like “wp_options”, depending on your prefix) and select the the row where “option_name” is “tribe_events_calendar_options”.
Search your additional field to find out it’s name. The name should be something like _ecp_custom_{X}, i.e. in my case: _ecp_custom_6.Go to folder:
/wp-content/plugins/the-events-calendar-filterbar/lib/filters/And create a file, in my case:
TribeEventsFilter_District.phpAdd this content:
<?php /** * Class TribeEventsFilter_District */ class TribeEventsFilter_District extends TribeEventsFilter { /** * Additional fields are stored in DB in table "options". * The "option_name" is "tribe_events_calendar_options". * Their option values are stored under their respective name "_ecp_custom_{X}", * "_ecp_custom_{X}" being the slug for this filter and {X} being the number (position in array) needed to retrieve the information. */ protected function get_ecp_custom_number(){ preg_match_all('!\d+!', $this->slug, $matches); $result = implode('', $matches[0]); return (int)$result; } /** * Fictive name for this filter to use in SQL query. */ protected function generate_custom_filter_join_name(){ return 'custom_filter_'.$this->slug; } /** * New line sometimes stays at the end of a value. */ protected function escape_new_line($string){ $result = $string; $result = str_replace("\r", '', $result); $result = str_replace("\n", '', $result); return $result; } public function get_admin_form() { $title = $this->get_title_field(); $type = $this->get_type_field(); return $title.$type; } protected function get_type_field() { $name = $this->get_admin_field_name('type'); $field = sprintf( __( 'Type: %s %s %s %s', 'tribe-events-filter-view' ), sprintf( '<label><input type="radio" name="%s" value="select" %s /> %s</label>', $name, checked( $this->type, 'select', false ), __( 'Dropdown', 'tribe-events-filter-view' ) ), sprintf( '<label><input type="radio" name="%s" value="radio" %s /> %s</label>', $name, checked( $this->type, 'radio', false ), __( 'Radio Buttons', 'tribe-events-calendar-pro' ) ), sprintf( '<label><input type="radio" name="%s" value="checkbox" %s /> %s</label>', $name, checked( $this->type, 'checkbox', false ), __( 'Checkboxes', 'tribe-events-filter-view' ) ), sprintf( '<label><input type="radio" name="%s" value="autocomplete" %s /> %s</label>', $name, checked( $this->type, 'autocomplete', false ), __( 'Autocomplete', 'tribe-events-filter-view' ) ) ); return '<div class="tribe_events_active_filter_type_options">'.$field.'</div>'; } protected function get_values() { $options = get_option( 'tribe_events_calendar_options', false ); $options_this_filter = $options['custom-fields'][$this->get_ecp_custom_number()]; $array_values = explode(PHP_EOL, $options_this_filter['values']); $values = array(); foreach($array_values as $value){ $value = $this->escape_new_line($value); $values[] = array( 'name' => __( $value, 'tribe-events-filter-view' ), 'value' => $value, ); } return $values; } protected function setup_join_clause() { global $wpdb; $custom_filter_join_name = $this->generate_custom_filter_join_name(); $this->joinClause = " LEFT JOIN {$wpdb->postmeta} AS {$custom_filter_join_name} ON ({$wpdb->posts}.ID = {$custom_filter_join_name}.post_id)"; } protected function setup_where_clause() { global $wpdb; $custom_filter_join_name = $this->generate_custom_filter_join_name(); $clauses = array(); $sql_prepare = "({$custom_filter_join_name}.meta_key = '".$this->slug."' AND {$custom_filter_join_name}.meta_value = %s AND {$custom_filter_join_name}.meta_value IS NOT NULL) "; if (is_array($this->currentValue)){ foreach ( $this->currentValue as $value ){ $clauses[] = $wpdb->prepare($sql_prepare, $value); } } else{ $clauses[] = $wpdb->prepare($sql_prepare, $this->currentValue); } $this->whereClause = ' AND ('.implode(' OR ', $clauses).') '; } }
Open file:
/wp-content/plugins/the-events-calendar-filterbar/lib/tribe-filter-view.class.phpGo to function:
initialize_filtersAnd add your filter, taking care of your filter’s name, in my case it’s “_ecp_custom_6”:
new TribeEventsFilter_District( __( 'District', 'tribe-events-filter-view' ), '_ecp_custom_6');
That’s it! Hope it helps.
GDPR20191021ParticipantWhat could be the issue?
GDPR20191021ParticipantI’m sorry, I did a mistake. Here’s the right code:
add_filter(‘tribe_events_all_filters_array’, ‘custom_add_filter_callback’);
function custom_add_filter_callback($filters) {
$filters[‘eventcomplete’] = array(
‘name’ => ‘Complete’,
‘type’ => ‘checkbox’,
‘admin_form’ => ‘custom-field[_2]’,
);
return $filters;
}GDPR20191021ParticipantHi Brian,
I’ve already seen these topics and tried to copy/paste and integrate in functions.php (like any other hooks), but it doesn’t work for me. Here’s my code:add_filter(‘tribe_events_all_filters_array’, ‘custom_add_filter_callback’);
public function custom_add_filter_callback($filters) {
$filters[‘eventcomplete’] = array(
‘name’ => ‘Complete’,
‘type’ => ‘checkbox’,
‘admin_form’ => ‘custom-field[_2]’,
);
return $filters;
}Thanks in advance!
GDPR20191021ParticipantHi,
I’ve found a solution to my problem. I did a change in the file:
/wp-content/plugins/the-events-calendar-community-events/tribe-community-events/tribe-community-events.php
In the function “addRoutes” at line ~389 for all lines like:
‘path’ => ‘^’ . $this->getCommunityRewriteSlug() . ‘/’ .
I removed the ‘^’, so I have only:
‘path’ => $this->getCommunityRewriteSlug() . ‘/’ .Best regards.
GDPR20191021ParticipantHi Josh,
one more question: is it possible to do this with your “Community Events” plugin, so that the logged in user has it’s own “Event Organizer” and it’s own “Venue”?
Thanks in advance for your help!GDPR20191021ParticipantHi Josh,
thanks for your reply! I’ll give it a try.
Best regards.GDPR20191021ParticipantHi,
thank you for your advice!
For now I will test with the plugin organizer. I hope that your fix will come out soon, as WPML is becoming a standard for multilanguage sites.
Best regards.GDPR20191021ParticipantIt seems this could be an issue with WPML.
Is there a way to change the loading order of the plugins so “tribe-events-calendar-pro” and “tribe-events-calendar” could load together, or one after another and have the same language? Maybe this would fix the problem.GDPR20191021ParticipantBy the way: I deleted and reinstalled, but nothing changed. Still the same issue.
GDPR20191021ParticipantHi,
thanks for your reply.
Here’s an overview of how my plugins are loaded in chronological order with the locale at the time of loading:
1. en_US: new-user-approve
2. en_US: tribe-events-calendar-pro
3. de_DE: sidebar-login
4. de_DE: tribe-events-calendar
5. de_DE: sitepress
6. de_DE: wpml-string-translationAs you can see, at the beginning the locale is still “en_US”, but should be “de_DE”. All translations for “tribe-events-calendar-pro” are in english while “tribe-events-calendar” is correctly in german.
Best regards.
GDPR20191021ParticipantHello Josh,
thanks for your reply! And yes, I’m working with WPML.
In the meantime I found out how to resolve this issue.
In the file “wp-content/plugins/the-events-calendar/resources/tribe-events-ajax-calendar.js” in the function “tribe_events_calendar_ajax_post” at line 385, I added the parameter “lang” with the current language. This worked for me.Best regards.
-
AuthorPosts