因为文本由_()
当然,您可以使用gettext
滤器
function change_update_notification_msg( $translated_text, $untranslated_text, $domain )
{
if ( is_admin() ) {
$texts = array(
\'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.\' => \'My custom notification. There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>.\',
\'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>\' => \'My custom notification. There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>\',
\'There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.\' => \'My custom notification. There is a new version of %1$s available. <a href="%2$s" %3$s>View version %4$s details</a> or <a href="%5$s" %6$s>update now</a>.\'
);
if ( array_key_exists( $untranslated_text, $texts ) ) {
return $texts[$untranslated_text];
}
}
return $translated_text;
}
add_filter( \'gettext\', \'change_update_notification_msg\', 20, 3 );