From 8b26ed504c87d3567f7e48f9c6bdeb2ff10fd042 Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Wed, 27 Feb 2013 22:10:08 +0000 Subject: [PATCH] Remove default content from post format compat output. We shouldn't magically create content for display not specified by the user, especially given that the current compat is handling the case of new data, old theme. see #23347. git-svn-id: https://develop.svn.wordpress.org/trunk@23499 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-formats.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php index 6d32aea330..828447b6e1 100644 --- a/wp-includes/post-formats.php +++ b/wp-includes/post-formats.php @@ -300,9 +300,6 @@ function post_formats_compat( $content, $id = 0 ) { 'class' => get_post_format_content_class( $format ), 'link_class' => '', 'image_class' => '', - 'gallery' => '[gallery]', - 'audio' => '', - 'video' => '' ); $args = apply_filters( 'post_format_compat', array() ); @@ -376,9 +373,7 @@ function post_formats_compat( $content, $id = 0 ) { } } - if ( empty( $meta['gallery'] ) && ! empty( $compat['gallery'] ) ) { - $format_output .= $compat['gallery']; - } elseif ( ! empty( $meta['gallery'] ) ) { + if ( ! empty( $meta['gallery'] ) ) { $format_output .= $meta['gallery']; } break; @@ -388,9 +383,7 @@ function post_formats_compat( $content, $id = 0 ) { $shortcode_regex = '/' . get_shortcode_regex() . '/s'; $matches = preg_match( $shortcode_regex, $content ); if ( ! $matches || $format !== $matches[2] ) { - if ( empty( $meta['media'] ) && ! empty( $compat[$format] ) ) { - $format_output .= $compat[$format]; - } elseif ( ! empty( $meta['media'] ) ) { + if ( ! empty( $meta['media'] ) ) { // the metadata is a shortcode or an embed code if ( preg_match( $shortcode_regex, $meta['media'] ) || preg_match( '#<[^>]+>#', $meta['media'] ) ) { $format_output .= $meta['media'];