尝试以下代码。
add_filter( \'gettext\', \'excerpt_gettext\', 10, 2 );
function excerpt_gettext( $translation, $original ) {
$post_type = get_post_type( $_GET[\'post\'] );
if($post_type == \'your custom post type\') {
$text = strpos($original, \'Excerpts are optional hand-crafted summaries of your content that can be used in your theme\');
if ($text !== false) {
return \'My Custom Excerpt Discription\';
}
}
return $translation;
}
NOTE: Change "your custom post type" with your actual post type name
希望这对你有帮助