Ticket #36934: 36934.3.patch
File 36934.3.patch, 2.5 KB (added by , 9 years ago) |
---|
-
src/wp-includes/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' ); -
src/wp-includes/formatting.php
2881 2881 * The ' […]' string can be modified by plugins/themes using the {@see 'excerpt_more'} filter 2882 2882 * 2883 2883 * @since 1.5.0 2884 * @since 4.6.0 Introduced the `$post` parameter. 2884 2885 * 2885 2886 * @param string $text Optional. The excerpt. If set to empty, an excerpt is generated. 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 $text = get_the_content( '', false, $post ); 2892 2893 2893 2894 $text = strip_shortcodes( $text ); 2894 2895 -
src/wp-includes/post-template.php
246 246 * Retrieve the post content. 247 247 * 248 248 * @since 0.71 249 * @since 4.6.0 Introduced the `$post` parameter. 249 250 * 250 251 * @global int $page 251 252 * @global int $more … … 255 256 * 256 257 * @param string $more_link_text Optional. Content for when there is more text. 257 258 * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false. 259 * @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. 258 260 * @return string 259 261 */ 260 function get_the_content( $more_link_text = null, $strip_teaser = false ) {262 function get_the_content( $more_link_text = null, $strip_teaser = false, $post = false ) { 261 263 global $page, $more, $preview, $pages, $multipage; 262 264 263 $post = get_post( );265 $post = get_post( $post ); 264 266 265 267 if ( null === $more_link_text ) 266 268 $more_link_text = __( '(more…)' );