Skip to content

Fix/hours of operation array handling#8

Open
MohanRaj168 wants to merge 3 commits intomainfrom
fix/hours-of-operation-array-handling
Open

Fix/hours of operation array handling#8
MohanRaj168 wants to merge 3 commits intomainfrom
fix/hours-of-operation-array-handling

Conversation

@MohanRaj168
Copy link
Contributor

Fixing the hours of operation array handling and weekly appearance structure updated

  • Added internationalization (i18n) support for hours of operation display
    • Day names now render in the WordPress site language using core locale ($wp_locale)
    • Added translate_description() helper to translate status values (e.g. "Closed", "Open 24 hours")
    • Added load_plugin_textdomain() so plugin-specific strings load from the language/ directory
    • Updated .pot file with all translatable strings

Bug

  • Fixed hours of operation not displaying days with no open/close times (e.g. Saturday/Sunday marked as Closed)
  • Fixed undefined $description variable in Deprecated.php hours methods causing Closed days to be silently skipped
  • Fixed inconsistent description rendering — all three renderers (Shortcode, Deprecated, Gutenberg) now consistently append description in parentheses when both hours and a description are present

https://vendasta.jira.com/browse/WSP-3092

MohanRaj168 and others added 3 commits February 12, 2026 04:30
… blocks

- Add render_hours_of_operation() method in Shortcode.php to properly handle nested array structure
- Fix hours_of_operation rendering logic in Deprecated.php for both legacy shortcodes
- Add format_array_value() and format_hours_of_operation() helpers in GutenbergBlock.php
- Resolve "Array to string conversion" errors by properly iterating through nested time blocks
- Each time block now correctly displays days, opening times, and closing times

Fixes issue where [business_profile attr='hours_of_operation'] displayed "Array" instead of formatted hours.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

2 participants