sprintf()
可用于拆分字符串,以便将可翻译字符串与HTML隔离:
function new_excerpt_more( $more ) {
return sprintf( \'<a href="%1$s"><span class="readmore">%2$s</span></a>\',
get_permalink( get_the_ID() ),
__( \'Read More\', \'your-textdomain\' )
);
}
add_filter( \'excerpt_more\', \'new_excerpt_more\' );