将短代码中的项目转换为数组,并返回列表:
add_shortcode( \'features_list\', \'shortcode_features_list\' );
function shortcode_features_list( $atts = array(), $content = \'\' )
{
$content = trim( $content );
if ( \'\' === $content )
return;
$items = explode( "\\n", $content );
$items = array_map( \'trim\', $items );
return \'<ul class="features"><li>\' . join( \'</li><li>\', $items ) . \'</li></ul>\';
}