Make WordPress Core


Ignore:
Timestamp:
04/17/2013 08:57:44 PM (12 years ago)
Author:
markjaquith
Message:

Standardize post format postmeta keys around the ones already used by the Crowd Favorite plugin.

props wonderboymusic. fixes #24010.

File:
1 edited

Legend:

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

    r24006 r24021  
    20752075    if ( has_post_format( $type, $post ) ) {
    20762076        $meta = get_post_format_meta( $post->ID );
    2077         if ( ! empty( $meta[$type] ) ) {
    2078             if ( is_integer( $meta[$type] ) ) {
    2079                 $url = wp_get_attachment_url( $meta[$type] );
     2077        if ( ! empty( $meta[$type . '_embed'] ) ) {
     2078            $value = $meta[$type . '_embed'];
     2079            if ( is_integer( $value ) ) {
     2080                $url = wp_get_attachment_url( $value );
    20802081                $shortcode = sprintf( '[%s src="%s"]', $type, $url );
    2081             } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $meta[$type] ) ) {
    2082                 $shortcode = $meta[$type];
    2083             } elseif ( preg_match( '#<[^>]+>#', $meta[$type] ) ) {
    2084                 $post->format_content = $meta[$type];
     2082            } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) {
     2083                $shortcode = $value;
     2084            } elseif ( preg_match( '#<[^>]+>#', $value ) ) {
     2085                $post->format_content = $value;
    20852086                return $post->format_content;
    2086             } elseif ( 0 === strpos( $meta[$type], 'http' ) ) {
    2087                 $post->split_content = str_replace( $meta[$type], '', $post->post_content, $count );
    2088                 if ( strstr( $meta[$type], home_url() ) ) {
    2089                     $shortcode = sprintf( '[%s src="%s"]', $type, $meta[$type] );
     2087            } elseif ( 0 === strpos( $value, 'http' ) ) {
     2088                $post->split_content = str_replace( $value, '', $post->post_content, $count );
     2089                if ( strstr( $value, home_url() ) ) {
     2090                    $shortcode = sprintf( '[%s src="%s"]', $type, $value );
    20902091                } else {
    2091                     $post->format_content = $wp_embed->autoembed( $meta[$type] );
     2092                    $post->format_content = $wp_embed->autoembed( $value );
    20922093                    return $post->format_content;
    20932094                }
Note: See TracChangeset for help on using the changeset viewer.