以前,我可以在我的函数中使用这样的脚本,为每个帖子更改日期和时间的数字(转换为另一种语言的数字和日期系统,如高棉语)。php:
function KhmerNumDate ($text) {
$text = str_replace(\'1\', \'១\', $text);
$text = str_replace(\'2\', \'២\', $text);
$text = str_replace(\'3\', \'៣\', $text);
$text = str_replace(\'4\', \'៤\', $text);
$text = str_replace(\'5\', \'៥\', $text);
$text = str_replace(\'6\', \'៦\', $text);
$text = str_replace(\'7\', \'៧\', $text);
$text = str_replace(\'8\', \'៨\', $text);
$text = str_replace(\'9\', \'៩\', $text);
$text = str_replace(\'0\', \'០\', $text);
return $text;
}
add_filter(\'date\', \'KhmerNumDate\');
add_filter(\'the_date\', \'KhmerNumDate\');
add_filter(\'the_time\', \'KhmerNumDate\');
但现在它不起作用了——我的代码好吗?代码是否会根据我使用的主题而有所不同(我目前使用的是一个修改过的儿童主题,即二十一岁)?