override get_date option.

This commit is contained in:
CBS Information System 2020-11-17 15:12:51 +09:00
parent 741c51d448
commit 9d072d063a

View File

@ -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;
}