Export: Remove extra whitespace from <title>
, <content:encoded>
, and <excerpt:encoded>
elements in WXR files.
Props sgastard, juliarrr, aristath, SergeyBiryukov. Fixes #46575. git-svn-id: https://develop.svn.wordpress.org/trunk@45216 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9fa1b6f332
commit
c295378ecd
@ -530,22 +530,10 @@ function export_wp( $args = array() ) {
|
||||
// Begin Loop.
|
||||
foreach ( $posts as $post ) {
|
||||
setup_postdata( $post );
|
||||
$is_sticky = is_sticky( $post->ID ) ? 1 : 0;
|
||||
?>
|
||||
<item>
|
||||
<title>
|
||||
<?php
|
||||
|
||||
/** This filter is documented in wp-includes/feed.php */
|
||||
echo apply_filters( 'the_title_rss', $post->post_title );
|
||||
?>
|
||||
</title>
|
||||
<link><?php the_permalink_rss(); ?></link>
|
||||
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
|
||||
<dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>
|
||||
<guid isPermaLink="false"><?php the_guid(); ?></guid>
|
||||
<description></description>
|
||||
<content:encoded>
|
||||
<?php
|
||||
$title = apply_filters( 'the_title_rss', $post->post_title );
|
||||
|
||||
/**
|
||||
* Filters the post content used for WXR exports.
|
||||
*
|
||||
@ -553,11 +541,8 @@ function export_wp( $args = array() ) {
|
||||
*
|
||||
* @param string $post_content Content of the current post.
|
||||
*/
|
||||
echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
|
||||
?>
|
||||
</content:encoded>
|
||||
<excerpt:encoded>
|
||||
<?php
|
||||
$content = wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
|
||||
|
||||
/**
|
||||
* Filters the post excerpt used for WXR exports.
|
||||
*
|
||||
@ -565,9 +550,19 @@ function export_wp( $args = array() ) {
|
||||
*
|
||||
* @param string $post_excerpt Excerpt for the current post.
|
||||
*/
|
||||
echo wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
|
||||
$excerpt = wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
|
||||
|
||||
$is_sticky = is_sticky( $post->ID ) ? 1 : 0;
|
||||
?>
|
||||
</excerpt:encoded>
|
||||
<item>
|
||||
<title><?php echo $title; ?></title>
|
||||
<link><?php the_permalink_rss(); ?></link>
|
||||
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
|
||||
<dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>
|
||||
<guid isPermaLink="false"><?php the_guid(); ?></guid>
|
||||
<description></description>
|
||||
<content:encoded><?php echo $content; ?></content:encoded>
|
||||
<excerpt:encoded><?php echo $excerpt; ?></excerpt:encoded>
|
||||
<wp:post_id><?php echo intval( $post->ID ); ?></wp:post_id>
|
||||
<wp:post_date><?php echo wxr_cdata( $post->post_date ); ?></wp:post_date>
|
||||
<wp:post_date_gmt><?php echo wxr_cdata( $post->post_date_gmt ); ?></wp:post_date_gmt>
|
||||
|
Loading…
Reference in New Issue
Block a user