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: http://core.svn.wordpress.org/trunk@23468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2013-02-21 23:02:00 +00:00
parent 7a21a5c0f6
commit 65991cb964

View File

@ -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( '</%s>', tag_escape( $compat['tag'] ) );
if ( ! empty( $content ) && $show_content && 'before' === $compat['position'] )
$output .= PHP_EOL . PHP_EOL . $content;
$output .= "\n\n" . $content;
return $output;
}