From 9d072d063ab848c2957f3b9063bba44b4405c241 Mon Sep 17 00:00:00 2001 From: NIU Administrator Date: Tue, 17 Nov 2020 15:12:51 +0900 Subject: [PATCH] override get_date option. --- functions.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/functions.php b/functions.php index a0ba2ba..701111b 100644 --- a/functions.php +++ b/functions.php @@ -214,3 +214,16 @@ function cbsonline_add_page_to_tag_archive($obj) $obj->query_vars['post_type'] = ['post', 'page']; } } + +// override date_format option +add_filter('option_date_format', 'cbsonline_date_format'); +function cbsonline_date_format($format) { + $lang = get_query_var('lang', ''); + switch($lang) { + case 'ja': + return 'Y年n月j日'; + case 'en_US': + return 'D, d M Y'; + } + return $format; +}