From a3afd6e9897df31540a53899ffc1ebb7461ba092 Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 21 Feb 2013 23:02:00 +0000 Subject: [PATCH] Post formats compat output: * Check for theme support of `structured-post-formats` rather than `post-formats`. * Use \n instead of PHP_EOL constant. * Add new lines after opening compat wrapper tag for some `wpautop()` treatment. props SergeyBiryukov. see #23347. git-svn-id: https://develop.svn.wordpress.org/trunk@23468 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-formats.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php index d8431daffb..6d32aea330 100644 --- a/wp-includes/post-formats.php +++ b/wp-includes/post-formats.php @@ -291,7 +291,7 @@ function post_formats_compat( $content, $id = 0 ) { if ( empty( $format ) || in_array( $format, array( 'status', 'aside', 'chat' ) ) ) return $content; - if ( current_theme_supports( 'post-formats', $format ) ) + if ( current_theme_supports( 'structured-post-formats', $format ) ) return $content; $defaults = array( @@ -412,18 +412,18 @@ function post_formats_compat( $content, $id = 0 ) { $output = ''; if ( ! empty( $content ) && $show_content && 'before' !== $compat['position'] ) - $output .= $content . PHP_EOL . PHP_EOL; + $output .= $content . "\n\n"; if ( ! empty( $compat['tag'] ) ) $output .= sprintf( '<%s class="%s">', tag_escape( $compat['tag'] ), esc_attr( $compat['class'] ) ); - $output .= $format_output; + $output .= "\n\n" . $format_output; if ( ! empty( $compat['tag'] ) ) $output .= sprintf( '', tag_escape( $compat['tag'] ) ); if ( ! empty( $content ) && $show_content && 'before' === $compat['position'] ) - $output .= PHP_EOL . PHP_EOL . $content; + $output .= "\n\n" . $content; return $output; }