From b04023c64a5324545323c6d772c9d05a0bf7e887 Mon Sep 17 00:00:00 2001 From: Aftabul Islam Date: Tue, 21 Nov 2023 10:47:03 +0600 Subject: [PATCH] feat: short form of days added. (#1989) --- includes/functions.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 16d77ec608..d39da0a525 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -2996,11 +2996,13 @@ function dokan_get_jed_locale_data( $domain, $language_dir = null ) { * * @since 2.8.2 * - * @param string|null days + * @param string|null $days + * @maram string/null $form * * @return string|array */ -function dokan_get_translated_days( $day = '' ) { +function dokan_get_translated_days( $day = '', $form = 'long' ) { + $all_days = [ 'sunday' => __( 'Sunday', 'dokan-lite' ), 'monday' => __( 'Monday', 'dokan-lite' ), @@ -3011,6 +3013,18 @@ function dokan_get_translated_days( $day = '' ) { 'saturday' => __( 'Saturday', 'dokan-lite' ), ]; + if ( 'short' === $form ) { + $all_days = [ + 'sunday' => __( 'Sun', 'dokan-lite' ), + 'monday' => __( 'Mon', 'dokan-lite' ), + 'tuesday' => __( 'Tue', 'dokan-lite' ), + 'wednesday' => __( 'Wed', 'dokan-lite' ), + 'thursday' => __( 'Thu', 'dokan-lite' ), + 'friday' => __( 'Fri', 'dokan-lite' ), + 'saturday' => __( 'Sat', 'dokan-lite' ), + ]; + } + $week_starts_on = get_option( 'start_of_week', 0 ); $day_keys = array_keys( $all_days );