Make WordPress Core

Ticket #23347: 23347.9.diff

File 23347.9.diff, 1.3 KB (added by helen, 11 years ago)
  • wp-includes/post-formats.php

     
    300300                'class' => get_post_format_content_class( $format ),
    301301                'link_class' => '',
    302302                'image_class' => '',
    303                 'gallery' => '[gallery]',
    304                 'audio' => '',
    305                 'video' => ''
    306303        );
    307304
    308305        $args = apply_filters( 'post_format_compat', array() );
     
    376373                                }
    377374                        }
    378375
    379                         if ( empty( $meta['gallery'] ) && ! empty( $compat['gallery'] ) ) {
    380                                 $format_output .= $compat['gallery'];
    381                         } elseif ( ! empty( $meta['gallery'] ) ) {
     376                        if ( ! empty( $meta['gallery'] ) ) {
    382377                                $format_output .= $meta['gallery'];
    383378                        }
    384379                        break;
     
    388383                        $shortcode_regex = '/' . get_shortcode_regex() . '/s';
    389384                        $matches = preg_match( $shortcode_regex, $content );
    390385                        if ( ! $matches || $format !== $matches[2] ) {
    391                                 if ( empty( $meta['media'] ) && ! empty( $compat[$format] ) ) {
    392                                         $format_output .= $compat[$format];
    393                                 } elseif ( ! empty( $meta['media'] ) ) {
     386                                if ( ! empty( $meta['media'] ) ) {
    394387                                        // the metadata is a shortcode or an embed code
    395388                                        if ( preg_match( $shortcode_regex, $meta['media'] ) || preg_match( '#<[^>]+>#', $meta['media'] ) ) {
    396389                                                $format_output .= $meta['media'];