Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wish: extend Shortcode/IsOpen.php / next_format by %5$s- %6$s in order to allow display of complete working hours of a day even if team takes a two hour break to eat in between. #1

Open
ash-tsc opened this issue Jul 1, 2019 · 2 comments

Comments

@ash-tsc
Copy link

ash-tsc commented Jul 1, 2019

[op-is-open set_id="352" open_text="Unsere Praxis in Arbergen ist geöffnet." closed_text="Unsere Praxis in Arbergen ist geschlossen." closed_holiday_text="Unsere Praxis in Arbergen ist aufgrund von %1$s geschlossen." show_next="true" next_format="Wir sind am %2$s den %1$s von %3$s bis %4$s und %5$s- %6$s Uhr wieder für Sie da!" show_today="open" today_format="Heutige Öffnungszeiten: %1$s"]

Warning: sprintf(): Too few arguments in /www/htdocs/w011cae2/wordpress.zoum.de/wp-content/plugins/wp-opening-hours/classes/OpeningHours/Module/Shortcode/IsOpen.php

@ash-tsc ash-tsc changed the title wish: extend Shortcode/IsOpen.php / next_format by %5$s- %6$s in order to allow display of complete working hours of a day even if teams takes a two hour break to eat in between. wish: extend Shortcode/IsOpen.php / next_format by %5$s- %6$s in order to allow display of complete working hours of a day even if team takes a two hour break to eat in between. Jul 1, 2019
@janizde
Copy link
Owner

janizde commented Jul 1, 2019

Hi @ash-tsc,

this question has also been asked on the main plugin repo: janizde/WP-Opening-Hours#120

The problem here is that the next_format is static but the number of periods per day may change (so the number of placeholder parameters changes per day if not all have the same number of periods). So when the parameters were just extended, the error message above would occur on some days and on some days not, which will probably lead to more confusion.

The only possible solution ATM is to use the appropriate filter as suggested in the linked issue:

Custom next period message with all periods of the day: You can use the op_is_open_format_next filter for this. The filter function will get the $todayData as the fourth argument which contains all of the periods, holidays and irregular openings on that day

@ash-tsc
Copy link
Author

ash-tsc commented Jul 1, 2019

Bummer. Then we will have to go for:
image
Because not displaying the complete working hours of the day seems to confuse doctors and patients! ;)
Thanks anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants