要做到这一点,一种更可靠(且不太老套)的方法是:
function rename_post_formats($translation, $text, $context, $domain) {
$names = array(
\'Audio\' => \'Podcast\',
\'Status\' => \'Tweet\'
);
if ($context == \'Post format\') {
$translation = str_replace(array_keys($names), array_values($names), $text);
}
return $translation;
}
add_filter(\'gettext_with_context\', \'rename_post_formats\', 10, 4);