Changeset 2686340
- Timestamp:
- 03/01/2022 06:50:50 AM (4 years ago)
- Location:
- multislot-business-hours-for-dokan-vendor/trunk
- Files:
-
- 3 edited
-
core/functions.php (modified) (2 diffs)
-
multislot-business-hours-for-dokan-vendor.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
multislot-business-hours-for-dokan-vendor/trunk/core/functions.php
r2601270 r2686340 57 57 58 58 if ( 'open' === $status ) { 59 foreach ( $schedule as $key => $time ) {60 if ( strpos( $key, 'opening_time' ) !== false ) {61 if ( $time ) $is_filled_data++;62 $time_key = (int) filter_var( $key, FILTER_SANITIZE_NUMBER_INT);63 $time_key = ( $time_key ? '_'.$time_key : '' );64 $opening_key = 'opening_time'. $time_key;65 $closing_key = 'closing_time' . $time_key;66 $open = \DateTimeImmutable::createFromFormat( esc_attr( get_option( 'time_format' ) ), $schedule[$opening_key], new \DateTimeZone( dokan_wp_timezone_string() ) );67 $close = \DateTimeImmutable::createFromFormat( esc_attr( get_option( 'time_format' ) ), $schedule[$closing_key], new \DateTimeZone( dokan_wp_timezone_string() ) );68 59 69 if ( $open <= $current_time && $close >= $current_time ) { 70 return true; 71 } 60 foreach ( $schedule['opening_time'] as $key => $time ) { 61 if ( $time ) $is_filled_data++; 62 $opening_key = $key; 63 $closing_key = $key; 64 $open = \DateTimeImmutable::createFromFormat( esc_attr( get_option( 'time_format' ) ), $schedule['opening_time'][$opening_key], new \DateTimeZone( dokan_wp_timezone_string() ) ); 65 $close = \DateTimeImmutable::createFromFormat( esc_attr( get_option( 'time_format' ) ), $schedule['closing_time'][$closing_key], new \DateTimeZone( dokan_wp_timezone_string() ) ); 66 if ( $open <= $current_time && $close >= $current_time ) { 67 return true; 72 68 } 73 69 } … … 85 81 $str = ''; 86 82 if ( 'open' === $schedule['status'] ) { 87 foreach ( $schedule as $key => $time ) { 88 if ( strpos( $key, 'opening_time' ) !== false ) { 89 if ( $time ) $is_filled_data++; 90 $time_key = (int) filter_var( $key, FILTER_SANITIZE_NUMBER_INT); 91 $time_key = ( $time_key ? '_'.$time_key : '' ); 92 $opening_key = 'opening_time'. $time_key; 93 $closing_key = 'closing_time' . $time_key; 94 $open = \DateTimeImmutable::createFromFormat( esc_attr( get_option( 'time_format' ) ), $schedule[$opening_key], new \DateTimeZone( dokan_wp_timezone_string() ) ); 95 $close = \DateTimeImmutable::createFromFormat( esc_attr( get_option( 'time_format' ) ), $schedule[$closing_key], new \DateTimeZone( dokan_wp_timezone_string() ) ); 96 $open = $open ? date( 'H:i:s', $open->getTimestamp() ) : ''; 97 $close = $close ? date('H:i:s', $close->getTimestamp() ) : ''; 98 99 $str .= $open . '-' . $close.'/'; 100 //$str .= ( $open ? date( 'H:i:s', $open->getTimestamp() ) : '' ) . '-' . ( $close ? date('H:i:s', $close->getTimestamp() . '/' ) : '' ); 101 } 83 foreach ( $schedule['opening_time'] as $key => $time ) { 84 if ( $time ) $is_filled_data++; 85 $opening_key = $key; 86 $closing_key = $key; 87 $open = \DateTimeImmutable::createFromFormat( esc_attr( get_option( 'time_format' ) ), $schedule['opening_time'][$opening_key], new \DateTimeZone( dokan_wp_timezone_string() ) ); 88 $close = \DateTimeImmutable::createFromFormat( esc_attr( get_option( 'time_format' ) ), $schedule['closing_time'][$closing_key], new \DateTimeZone( dokan_wp_timezone_string() ) ); 89 $open = $open ? date( 'H:i:s', $open->getTimestamp() ) : ''; 90 $close = $close ? date('H:i:s', $close->getTimestamp() ) : ''; 91 $str .= $open . '-' . $close.'/'; 102 92 } 103 93 } -
multislot-business-hours-for-dokan-vendor/trunk/multislot-business-hours-for-dokan-vendor.php
r2638647 r2686340 4 4 Plugin URI: 5 5 Description: Maintain Business hours for your WooCommerce Shop. Let your customers know about business schedules. 6 Version: 1.0.1. 56 Version: 1.0.1.6 7 7 Text Domain: doc 8 8 Author: CyberCraft -
multislot-business-hours-for-dokan-vendor/trunk/readme.txt
r2638647 r2686340 7 7 WC tested up to: 5.6.0 8 8 Requires PHP: 5.6 9 Stable tag: 1.0.1. 59 Stable tag: 1.0.1.6 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.