WordPress.org

Make WordPress Core

Ticket #10984: 10984.2.diff

File 10984.2.diff, 2.5 KB (added by jubstuff, 5 years ago)

Patch refreshed

  • src/wp-includes/feed.php

     
    186186                $feed_type = get_default_feed();
    187187
    188188        /** This filter is documented in wp-includes/post-template.php */
    189         $content = apply_filters( 'the_content', get_the_content() );
     189        $content = apply_filters( 'the_content', get_the_content( null, false, true ) );
    190190        $content = str_replace(']]>', ']]>', $content);
    191191        /**
    192192         * Filter the post content for use in feeds.
  • src/wp-includes/formatting.php

     
    28762876function wp_trim_excerpt( $text = '' ) {
    28772877        $raw_excerpt = $text;
    28782878        if ( '' == $text ) {
    2879                 $text = get_the_content('');
     2879                $text = get_the_content( '', false, true );
    28802880
    28812881                $text = strip_shortcodes( $text );
    28822882
  • src/wp-includes/post-template.php

     
    253253 * @global array $pages
    254254 * @global int   $multipage
    255255 *
    256  * @param string $more_link_text Optional. Content for when there is more text.
    257  * @param bool   $strip_teaser   Optional. Strip teaser content before the more text. Default is false.
     256 * @param string $more_link_text    Optional. Content for when there is more text.
     257 * @param bool   $strip_teaser      Optional. Strip teaser content before the more text. Default is false.
     258 * @param bool   $ignore_pagination Optional. Return full text, ignoring pagination. Default is false.
    258259 * @return string
    259260 */
    260 function get_the_content( $more_link_text = null, $strip_teaser = false ) {
     261function get_the_content( $more_link_text = null, $strip_teaser = false, $ignore_pagination = false ) {
    261262        global $page, $more, $preview, $pages, $multipage;
    262263
    263264        $post = get_post();
     
    275276        if ( $page > count( $pages ) ) // if the requested page doesn't exist
    276277                $page = count( $pages ); // give them the highest numbered page that DOES exist
    277278
    278         $content = $pages[$page - 1];
     279        if ( $ignore_pagination ) {
     280                $content = implode( "\n", $pages );
     281        } else {
     282                $content = $pages[ $page - 1 ];
     283        }
     284       
    279285        if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) {
    280286                $content = explode( $matches[0], $content, 2 );
    281287                if ( ! empty( $matches[1] ) && ! empty( $more_link_text ) )