如果输出描述时使用bloginfo()
, 您可以使用过滤器bloginfo
.
add_filter( \'bloginfo\', \'wpse183972_description_italic\', 10, 2 );
function wpse183972_description_italic( $text, $show )
{
if (\'description\' == $show) {
$word = \'WordPress\';
$text = preg_replace( \'^(\' . preg_quote( $word ) . \')^\', \'<em>$1</em>\', $text );
}
return $text;
}