Posted: December 2, 2014 at 8:32 am
|
Hi! I’m trying to localize the time and dates inside the ticket details slidedown info. I know the code exists here: /modules/ticket_selector/templates/ticket_selector_chart.template.php I also figured you might be using your builtin locate_template function to fetch this file so I tried placing a copy in uploads/espresso/templates/modules/ticket_selector/templates but it does not seem to work. If it did I could just change the format myself ๐ It seems you could really use either a format input in the settings or possibly use the format being set as default in wordpress settings. But in the meantime, is there a solution for me? Thanks! |
Hi Jonathan, Here are some options on localizing the date and time: Upcoming Date(s) and Time(s) Ticket Selector Additional Template Tags And here are some functions: /** * @param string $date_format * @return mixed|string|void */ function espresso_match_date_format_to_WP( $date_format = '' ) { $date_format = get_option('date_format'); return $date_format; } add_filter( 'FHEE__EED_Ticket_Selector__display_ticket_selector__date_format', 'espresso_match_date_format_to_WP', 10, 1 ); add_filter( 'FHEE__espresso_list_of_event_dates__date_format', 'espresso_match_date_format_to_WP', 10, 1 ); add_filter( 'FHEE__espresso_event_date__date_format', 'espresso_match_date_format_to_WP', 10, 1 ); add_filter( 'FHEE__espresso_event_end_date__date_format', 'espresso_match_date_format_to_WP', 10, 1 ); add_filter( 'FHEE__espresso_event_date_range__date_format', 'espresso_match_date_format_to_WP', 10, 1 ); /** * @param string $time_format * @return mixed|string|void */ function espresso_match_time_format_to_WP( $time_format = '' ) { $time_format = get_option('time_format'); return $time_format; } add_filter( 'FHEE__EED_Ticket_Selector__display_ticket_selector__time_format', 'espresso_match_time_format_to_WP', 10, 1 ); add_filter( 'FHEE__espresso_list_of_event_dates__time_format', 'espresso_match_time_format_to_WP', 10, 1 ); add_filter( 'FHEE__espresso_event_date__time_format', 'espresso_match_time_format_to_WP', 10, 1 ); add_filter( 'FHEE__espresso_event_end_date__time_format', 'espresso_match_time_format_to_WP', 10, 1 ); add_filter( 'FHEE__espresso_event_date_range__time_format', 'espresso_match_time_format_to_WP', 10, 1 ); Did you try adding that template here? /wp-content/themes/yourthemefolder — |
|
what specific version/branch are you using ? |
|
|
Lorenzo I’ll try these out in a bit and get back to you! Brent I’m using the latest stable version of 4.4 ๐ |
|
Thank you Lorenzo for the functions, they worked perfectly! You should post these on your documentation! |
The support post ‘Localize time and dates in ticket details’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.