関数 wp_html_excerpt()
2014/12/11
関数 wp_html_excerpt()
定義ファイル :/blog/wp-includes/formatting.php 11
1 2 3 4 5 6 7 8 9 10 11 | function wp_html_excerpt( $str, $count, $more = null ) { if ( null === $more ) $more = ''; $str = wp_strip_all_tags( $str, true ); $excerpt = mb_substr( $str, 0, $count ); // remove part of an entity at the end $excerpt = preg_replace( '/&[^;\s]{0,6}$/', '', $excerpt ); if ( $str != $excerpt ) $excerpt = trim( $excerpt ) . $more; return $excerpt; } |