From 2ba85268f86af6d5e222554c907f513f36c5b454 Mon Sep 17 00:00:00 2001 From: Manish Yadav Date: Fri, 18 Oct 2024 18:01:14 +0530 Subject: [PATCH 1/2] Fixed hours of operation --- src/Deprecated/Deprecated.php | 69 +++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 19 deletions(-) diff --git a/src/Deprecated/Deprecated.php b/src/Deprecated/Deprecated.php index 9809c1b..c73870e 100644 --- a/src/Deprecated/Deprecated.php +++ b/src/Deprecated/Deprecated.php @@ -243,33 +243,64 @@ public static function business_profile_render_services() { * Initializes the shortcodes for Hours of Operation */ - public static function business_profile_data_hours_of_operation() { + public static function business_profile_data_hours_of_operation() { $json_data = get_option('bpr_business_profile'); - $hours = $json_data['hours_of_operation']; - $hours_of_operation = ""; + $hours = $json_data['hours_of_operation'] ?? []; + + // Check if hours of operation exist if (empty($hours)) { - return ""; + return ""; } - return $hours_of_operation; - } - - public static function business_profile_render_hours_of_operation() { - $json_data = get_option('bpr_business_profile'); - $hours = $json_data['hours_of_operation']; - $hours_of_operation = "