Edit File by line
/home/zeestwma/richards.../wp-admin/includes
File: export.php
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
[500] Fix | Delete
<!-- 3. Install the "WordPress" importer from the list. -->
[501] Fix | Delete
<!-- 4. Activate & Run Importer. -->
[502] Fix | Delete
<!-- 5. Upload this file using the form provided on that page. -->
[503] Fix | Delete
<!-- 6. You will first be asked to map the authors in this export file to users -->
[504] Fix | Delete
<!-- on the site. For each author, you may choose to map to an -->
[505] Fix | Delete
<!-- existing user on the site or to create a new user. -->
[506] Fix | Delete
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
[507] Fix | Delete
<!-- contained in this file into your site. -->
[508] Fix | Delete
[509] Fix | Delete
<?php the_generator( 'export' ); ?>
[510] Fix | Delete
<rss version="2.0"
[511] Fix | Delete
xmlns:excerpt="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/excerpt/"
[512] Fix | Delete
xmlns:content="http://purl.org/rss/1.0/modules/content/"
[513] Fix | Delete
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
[514] Fix | Delete
xmlns:dc="http://purl.org/dc/elements/1.1/"
[515] Fix | Delete
xmlns:wp="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/"
[516] Fix | Delete
>
[517] Fix | Delete
[518] Fix | Delete
<channel>
[519] Fix | Delete
<title><?php bloginfo_rss( 'name' ); ?></title>
[520] Fix | Delete
<link><?php bloginfo_rss( 'url' ); ?></link>
[521] Fix | Delete
<description><?php bloginfo_rss( 'description' ); ?></description>
[522] Fix | Delete
<pubDate><?php echo gmdate( 'D, d M Y H:i:s +0000' ); ?></pubDate>
[523] Fix | Delete
<language><?php bloginfo_rss( 'language' ); ?></language>
[524] Fix | Delete
<wp:wxr_version><?php echo WXR_VERSION; ?></wp:wxr_version>
[525] Fix | Delete
<wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
[526] Fix | Delete
<wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>
[527] Fix | Delete
[528] Fix | Delete
<?php wxr_authors_list( $post_ids ); ?>
[529] Fix | Delete
[530] Fix | Delete
<?php foreach ( $cats as $c ) : ?>
[531] Fix | Delete
<wp:category>
[532] Fix | Delete
<wp:term_id><?php echo (int) $c->term_id; ?></wp:term_id>
[533] Fix | Delete
<wp:category_nicename><?php echo wxr_cdata( $c->slug ); ?></wp:category_nicename>
[534] Fix | Delete
<wp:category_parent><?php echo wxr_cdata( $c->parent ? $cats[ $c->parent ]->slug : '' ); ?></wp:category_parent>
[535] Fix | Delete
<?php
[536] Fix | Delete
wxr_cat_name( $c );
[537] Fix | Delete
wxr_category_description( $c );
[538] Fix | Delete
wxr_term_meta( $c );
[539] Fix | Delete
?>
[540] Fix | Delete
</wp:category>
[541] Fix | Delete
<?php endforeach; ?>
[542] Fix | Delete
<?php foreach ( $tags as $t ) : ?>
[543] Fix | Delete
<wp:tag>
[544] Fix | Delete
<wp:term_id><?php echo (int) $t->term_id; ?></wp:term_id>
[545] Fix | Delete
<wp:tag_slug><?php echo wxr_cdata( $t->slug ); ?></wp:tag_slug>
[546] Fix | Delete
<?php
[547] Fix | Delete
wxr_tag_name( $t );
[548] Fix | Delete
wxr_tag_description( $t );
[549] Fix | Delete
wxr_term_meta( $t );
[550] Fix | Delete
?>
[551] Fix | Delete
</wp:tag>
[552] Fix | Delete
<?php endforeach; ?>
[553] Fix | Delete
<?php foreach ( $terms as $t ) : ?>
[554] Fix | Delete
<wp:term>
[555] Fix | Delete
<wp:term_id><?php echo (int) $t->term_id; ?></wp:term_id>
[556] Fix | Delete
<wp:term_taxonomy><?php echo wxr_cdata( $t->taxonomy ); ?></wp:term_taxonomy>
[557] Fix | Delete
<wp:term_slug><?php echo wxr_cdata( $t->slug ); ?></wp:term_slug>
[558] Fix | Delete
<wp:term_parent><?php echo wxr_cdata( $t->parent ? $terms[ $t->parent ]->slug : '' ); ?></wp:term_parent>
[559] Fix | Delete
<?php
[560] Fix | Delete
wxr_term_name( $t );
[561] Fix | Delete
wxr_term_description( $t );
[562] Fix | Delete
wxr_term_meta( $t );
[563] Fix | Delete
?>
[564] Fix | Delete
</wp:term>
[565] Fix | Delete
<?php endforeach; ?>
[566] Fix | Delete
<?php
[567] Fix | Delete
if ( 'all' === $args['content'] ) {
[568] Fix | Delete
wxr_nav_menu_terms();
[569] Fix | Delete
}
[570] Fix | Delete
?>
[571] Fix | Delete
[572] Fix | Delete
<?php
[573] Fix | Delete
/** This action is documented in wp-includes/feed-rss2.php */
[574] Fix | Delete
do_action( 'rss2_head' );
[575] Fix | Delete
?>
[576] Fix | Delete
[577] Fix | Delete
<?php
[578] Fix | Delete
if ( $post_ids ) {
[579] Fix | Delete
/**
[580] Fix | Delete
* @global WP_Query $wp_query WordPress Query object.
[581] Fix | Delete
*/
[582] Fix | Delete
global $wp_query;
[583] Fix | Delete
[584] Fix | Delete
// Fake being in the loop.
[585] Fix | Delete
$wp_query->in_the_loop = true;
[586] Fix | Delete
[587] Fix | Delete
// Fetch 20 posts at a time rather than loading the entire table into memory.
[588] Fix | Delete
while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
[589] Fix | Delete
$where = 'WHERE ID IN (' . implode( ',', $next_posts ) . ')';
[590] Fix | Delete
$posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
[591] Fix | Delete
[592] Fix | Delete
// Begin Loop.
[593] Fix | Delete
foreach ( $posts as $post ) {
[594] Fix | Delete
setup_postdata( $post );
[595] Fix | Delete
[596] Fix | Delete
/**
[597] Fix | Delete
* Filters the post title used for WXR exports.
[598] Fix | Delete
*
[599] Fix | Delete
* @since 5.7.0
[600] Fix | Delete
*
[601] Fix | Delete
* @param string $post_title Title of the current post.
[602] Fix | Delete
*/
[603] Fix | Delete
$title = wxr_cdata( apply_filters( 'the_title_export', $post->post_title ) );
[604] Fix | Delete
[605] Fix | Delete
/**
[606] Fix | Delete
* Filters the post content used for WXR exports.
[607] Fix | Delete
*
[608] Fix | Delete
* @since 2.5.0
[609] Fix | Delete
*
[610] Fix | Delete
* @param string $post_content Content of the current post.
[611] Fix | Delete
*/
[612] Fix | Delete
$content = wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
[613] Fix | Delete
[614] Fix | Delete
/**
[615] Fix | Delete
* Filters the post excerpt used for WXR exports.
[616] Fix | Delete
*
[617] Fix | Delete
* @since 2.6.0
[618] Fix | Delete
*
[619] Fix | Delete
* @param string $post_excerpt Excerpt for the current post.
[620] Fix | Delete
*/
[621] Fix | Delete
$excerpt = wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
[622] Fix | Delete
[623] Fix | Delete
$is_sticky = is_sticky( $post->ID ) ? 1 : 0;
[624] Fix | Delete
?>
[625] Fix | Delete
<item>
[626] Fix | Delete
<title><?php echo $title; ?></title>
[627] Fix | Delete
<link><?php the_permalink_rss(); ?></link>
[628] Fix | Delete
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
[629] Fix | Delete
<dc:creator><?php echo wxr_cdata( get_the_author_meta( 'login' ) ); ?></dc:creator>
[630] Fix | Delete
<guid isPermaLink="false"><?php the_guid(); ?></guid>
[631] Fix | Delete
<description></description>
[632] Fix | Delete
<content:encoded><?php echo $content; ?></content:encoded>
[633] Fix | Delete
<excerpt:encoded><?php echo $excerpt; ?></excerpt:encoded>
[634] Fix | Delete
<wp:post_id><?php echo (int) $post->ID; ?></wp:post_id>
[635] Fix | Delete
<wp:post_date><?php echo wxr_cdata( $post->post_date ); ?></wp:post_date>
[636] Fix | Delete
<wp:post_date_gmt><?php echo wxr_cdata( $post->post_date_gmt ); ?></wp:post_date_gmt>
[637] Fix | Delete
<wp:post_modified><?php echo wxr_cdata( $post->post_modified ); ?></wp:post_modified>
[638] Fix | Delete
<wp:post_modified_gmt><?php echo wxr_cdata( $post->post_modified_gmt ); ?></wp:post_modified_gmt>
[639] Fix | Delete
<wp:comment_status><?php echo wxr_cdata( $post->comment_status ); ?></wp:comment_status>
[640] Fix | Delete
<wp:ping_status><?php echo wxr_cdata( $post->ping_status ); ?></wp:ping_status>
[641] Fix | Delete
<wp:post_name><?php echo wxr_cdata( $post->post_name ); ?></wp:post_name>
[642] Fix | Delete
<wp:status><?php echo wxr_cdata( $post->post_status ); ?></wp:status>
[643] Fix | Delete
<wp:post_parent><?php echo (int) $post->post_parent; ?></wp:post_parent>
[644] Fix | Delete
<wp:menu_order><?php echo (int) $post->menu_order; ?></wp:menu_order>
[645] Fix | Delete
<wp:post_type><?php echo wxr_cdata( $post->post_type ); ?></wp:post_type>
[646] Fix | Delete
<wp:post_password><?php echo wxr_cdata( $post->post_password ); ?></wp:post_password>
[647] Fix | Delete
<wp:is_sticky><?php echo (int) $is_sticky; ?></wp:is_sticky>
[648] Fix | Delete
<?php if ( 'attachment' === $post->post_type ) : ?>
[649] Fix | Delete
<wp:attachment_url><?php echo wxr_cdata( wp_get_attachment_url( $post->ID ) ); ?></wp:attachment_url>
[650] Fix | Delete
<?php endif; ?>
[651] Fix | Delete
<?php wxr_post_taxonomy(); ?>
[652] Fix | Delete
<?php
[653] Fix | Delete
$postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
[654] Fix | Delete
foreach ( $postmeta as $meta ) :
[655] Fix | Delete
/**
[656] Fix | Delete
* Filters whether to selectively skip post meta used for WXR exports.
[657] Fix | Delete
*
[658] Fix | Delete
* Returning a truthy value from the filter will skip the current meta
[659] Fix | Delete
* object from being exported.
[660] Fix | Delete
*
[661] Fix | Delete
* @since 3.3.0
[662] Fix | Delete
*
[663] Fix | Delete
* @param bool $skip Whether to skip the current post meta. Default false.
[664] Fix | Delete
* @param string $meta_key Current meta key.
[665] Fix | Delete
* @param object $meta Current meta object.
[666] Fix | Delete
*/
[667] Fix | Delete
if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) {
[668] Fix | Delete
continue;
[669] Fix | Delete
}
[670] Fix | Delete
?>
[671] Fix | Delete
<wp:postmeta>
[672] Fix | Delete
<wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
[673] Fix | Delete
<wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
[674] Fix | Delete
</wp:postmeta>
[675] Fix | Delete
<?php
[676] Fix | Delete
endforeach;
[677] Fix | Delete
[678] Fix | Delete
$_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
[679] Fix | Delete
$comments = array_map( 'get_comment', $_comments );
[680] Fix | Delete
foreach ( $comments as $c ) :
[681] Fix | Delete
?>
[682] Fix | Delete
<wp:comment>
[683] Fix | Delete
<wp:comment_id><?php echo (int) $c->comment_ID; ?></wp:comment_id>
[684] Fix | Delete
<wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
[685] Fix | Delete
<wp:comment_author_email><?php echo wxr_cdata( $c->comment_author_email ); ?></wp:comment_author_email>
[686] Fix | Delete
<wp:comment_author_url><?php echo sanitize_url( $c->comment_author_url ); ?></wp:comment_author_url>
[687] Fix | Delete
<wp:comment_author_IP><?php echo wxr_cdata( $c->comment_author_IP ); ?></wp:comment_author_IP>
[688] Fix | Delete
<wp:comment_date><?php echo wxr_cdata( $c->comment_date ); ?></wp:comment_date>
[689] Fix | Delete
<wp:comment_date_gmt><?php echo wxr_cdata( $c->comment_date_gmt ); ?></wp:comment_date_gmt>
[690] Fix | Delete
<wp:comment_content><?php echo wxr_cdata( $c->comment_content ); ?></wp:comment_content>
[691] Fix | Delete
<wp:comment_approved><?php echo wxr_cdata( $c->comment_approved ); ?></wp:comment_approved>
[692] Fix | Delete
<wp:comment_type><?php echo wxr_cdata( $c->comment_type ); ?></wp:comment_type>
[693] Fix | Delete
<wp:comment_parent><?php echo (int) $c->comment_parent; ?></wp:comment_parent>
[694] Fix | Delete
<wp:comment_user_id><?php echo (int) $c->user_id; ?></wp:comment_user_id>
[695] Fix | Delete
<?php
[696] Fix | Delete
$c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
[697] Fix | Delete
foreach ( $c_meta as $meta ) :
[698] Fix | Delete
/**
[699] Fix | Delete
* Filters whether to selectively skip comment meta used for WXR exports.
[700] Fix | Delete
*
[701] Fix | Delete
* Returning a truthy value from the filter will skip the current meta
[702] Fix | Delete
* object from being exported.
[703] Fix | Delete
*
[704] Fix | Delete
* @since 4.0.0
[705] Fix | Delete
*
[706] Fix | Delete
* @param bool $skip Whether to skip the current comment meta. Default false.
[707] Fix | Delete
* @param string $meta_key Current meta key.
[708] Fix | Delete
* @param object $meta Current meta object.
[709] Fix | Delete
*/
[710] Fix | Delete
if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
[711] Fix | Delete
continue;
[712] Fix | Delete
}
[713] Fix | Delete
?>
[714] Fix | Delete
<wp:commentmeta>
[715] Fix | Delete
<wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
[716] Fix | Delete
<wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
[717] Fix | Delete
</wp:commentmeta>
[718] Fix | Delete
<?php endforeach; ?>
[719] Fix | Delete
</wp:comment>
[720] Fix | Delete
<?php endforeach; ?>
[721] Fix | Delete
</item>
[722] Fix | Delete
<?php
[723] Fix | Delete
}
[724] Fix | Delete
}
[725] Fix | Delete
}
[726] Fix | Delete
?>
[727] Fix | Delete
</channel>
[728] Fix | Delete
</rss>
[729] Fix | Delete
<?php
[730] Fix | Delete
}
[731] Fix | Delete
[732] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function