Jake Vanderwerf
2026-05-03 9bbeea742424837fb58207d88e10dbca0b2cae04
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
namespace JVBase\managers\SEO\render\Traits\_Properties;
 
use JVBase\managers\SEO\render\Traits\_Helpers\arrayHelper;
 
if (!defined('ABSPATH')) {
    exit;
}
trait openingHoursTrait {
    use arrayHelper;
    /**
     * @var array|string The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'.
     *
     * Days are specified using the following two-letter combinations: Mo, Tu, We, Th, Fr, Sa, Su.
     * Times are specified using 24:00 format. For example, 3pm is specified as 15:00, 10am as 10:00.
     * Here is an example: <time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time>.
     * If a business is open 7 days a week, then it can be specified as <time itemprop="openingHours" datetime="Mo-Su">Monday through Sunday, all day</time>.
     */
    protected array|string $openingHours;
 
    public function getOpeningHours():array|string|null
    {
        return $this->openingHours??null;
    }
    public function setOpeningHours(array|string $openingHours):void
    {
        if (is_array($openingHours)) {
            $openingHours = $this->stringArray('openingHours', $openingHours);
        }
        $this->openingHours = $openingHours;
    }
}