Ticket #36934: 36394.diff
File 36394.diff, 1.5 KB (added by , 9 years ago) |
---|
-
default-filters.php
141 141 add_filter( 'the_excerpt', 'convert_chars' ); 142 142 add_filter( 'the_excerpt', 'wpautop' ); 143 143 add_filter( 'the_excerpt', 'shortcode_unautop'); 144 add_filter( 'get_the_excerpt', 'wp_trim_excerpt' 144 add_filter( 'get_the_excerpt', 'wp_trim_excerpt', 10, 2 ); 145 145 146 146 add_filter( 'comment_text', 'wptexturize' ); 147 147 add_filter( 'comment_text', 'convert_chars' ); -
formatting.php
2883 2883 * @since 1.5.0 2884 2884 * 2885 2885 * @param string $text Optional. The excerpt. If set to empty, an excerpt is generated. 2886 * @param int|WP_Post $post Optional. Post ID or WP_Post object. 2886 2887 * @return string The excerpt. 2887 2888 */ 2888 function wp_trim_excerpt( $text = '' ) {2889 function wp_trim_excerpt( $text = '', $post = null ) { 2889 2890 $raw_excerpt = $text; 2890 2891 if ( '' == $text ) { 2891 $text = get_the_content(''); 2892 if ( is_null( $post ) ) { 2893 $text = get_the_content( '' ); 2894 } else { 2895 $post = get_post( $post ); 2896 if ( ! empty( $post ) ) { 2897 $text = $post->post_content; 2898 } 2899 } 2892 2900 2893 2901 $text = strip_shortcodes( $text ); 2894 2902