Jake Vanderwerf
2026-02-04 2127b1bdd73ecd2423e443992da4b442f5a3c1a3
inc/helpers/time.php
@@ -1,6 +1,7 @@
<?php
use JVBase\managers\Cache;
use JVBase\meta\Meta;
if (!defined('ABSPATH')) {
   exit;
@@ -135,11 +136,11 @@
/**
 * @param int $ID
 * @param JVBase\Meta\MetaManager $meta
 * @param string $type
 *
 * @return string
 */
function jvbRenderHours(int $ID, JVBase\Meta\MetaManager $meta):string
function jvbRenderHours(int $ID, string $type = ''):string
{
   $cache = Cache::for('hours_display', WEEK_IN_SECONDS)->connect('taxonomy')->connect('post')->connect('user');
@@ -149,20 +150,22 @@
      return $cached;
   }
   $meta = match($type){
      'post'   => Meta::forPost($ID),
      'term'   => Meta::forTerm($ID),
      'user'   => Meta::forUser($ID),
      default  => false
   };
   if (!$meta) {
      if (term_exists($ID)) {
         $type = 'term';
      } elseif (get_post_status($ID)) {
         $type = 'post';
      } else {
         $type = 'user';
      $meta = jvbGetMeta($ID);
      }
      $meta = new JVBase\meta\MetaManager($ID, $type);
   if (!$meta) {
      return '';
   }
   $hours = $meta->getValue('hours');
   $byAppt = $meta->getValue('by_appointment');
   $walkins = $meta->getValue('walkins');
   $hours = $meta->get('hours');
   $byAppt = $meta->get('by_appointment');
   $walkins = $meta->get('walkins');
   $out = '';