Make WordPress Core


Ignore:
Timestamp:
06/03/2013 07:27:58 PM (13 years ago)
Author:
markjaquith
Message:

Lose content removal and splitting from the media extraction functions.

see #24484

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r24388 r24400  
    578578    public $format_content;
    579579
    580     /**
    581      * Private variable used by post formats to cache parsed content.
    582      *
    583      * @since 3.6.0
    584      *
    585      * @var string
    586      * @access private
    587      */
    588     public $split_content;
    589580
    590581    public static function get_instance( $post_id ) {
     
    49914982 *
    49924983 * @param object $post The post object.
    4993  * @param bool $remaining Whether to parse post formats from the content. Defaults to false.
    49944984 * @return array An array of values used for paginating the parsed content.
    49954985 */
    4996 function wp_parse_post_content( $post, $remaining = false ) {
     4986function wp_parse_post_content( $post ) {
    49974987    $numpages = 1;
    4998 
    4999     if ( $remaining ) {
    5000         $format = get_post_format( $post );
    5001         if ( $format && in_array( $format, array( 'image', 'audio', 'video', 'quote' ) ) ) {
    5002             // Call get_the_post_format_*() to set $post->split_content
    5003             switch ( $format ) {
    5004                 case 'image':
    5005                     get_the_post_format_image( 'full', $post );
    5006                     break;
    5007                 case 'audio':
    5008                     get_the_post_format_media( 'audio', $post, 1 );
    5009                     break;
    5010                 case 'video':
    5011                     get_the_post_format_media( 'video', $post, 1 );
    5012                     break;
    5013                 case 'quote':
    5014                     get_the_post_format_quote( $post );
    5015                     break;
    5016             }
    5017         }
    5018     }
    50194988
    50204989    if ( strpos( $post->post_content, '<!--nextpage-->' ) ) {
    50214990        $multipage = 1;
    5022         if ( $remaining && isset( $post->split_content ) )
    5023             $pages = paginate_content( $post->split_content );
    5024         else
    5025             $pages = paginate_content( $post->post_content );
     4991        $pages = paginate_content( $post->post_content );
    50264992        $numpages = count( $pages );
    50274993    } else {
    5028         if ( $remaining && isset( $post->split_content ) )
    5029             $pages = array( $post->split_content );
    5030         else
    5031             $pages = array( $post->post_content );
     4994        $pages = array( $post->post_content );
    50324995        $multipage = 0;
    50334996    }
Note: See TracChangeset for help on using the changeset viewer.