Skip to content

Commit 02e52c2

Browse files
improved the exports meta ordering and removed pubdate and generator because they change all the time
1 parent 86fde2f commit 02e52c2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bin/xml_export.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
$output .= '<?xml version="1.0" encoding="' . get_bloginfo('charset') . "\" ?>\n";
1818

19-
$output .= get_the_generator( 'export' );
19+
//$output .= get_the_generator( 'export' );
2020

2121
$output .= '<rss version="2.0"
2222
xmlns:excerpt="http://wordpress.org/export/' . WXR_VERSION . '/excerpt/"
@@ -29,7 +29,6 @@
2929
<title>' . get_bloginfo_rss( 'name' ) . '</title>
3030
<link>' . get_bloginfo_rss( 'url' ) . '</link>
3131
<description>' . get_bloginfo_rss( 'description' ) . '</description>
32-
<pubDate>' . date( 'D, d M Y H:i:s +0000' ) . '</pubDate>
3332
<language>' . get_option( 'rss_language' ) . '</language>
3433
<wp:wxr_version>' . WXR_VERSION . '</wp:wxr_version>
3534
<wp:base_site_url>' . wcli_wxr_site_url() . '</wp:base_site_url>
@@ -65,7 +64,7 @@
6564
<wp:post_password>' . $post->post_password . '</wp:post_password>
6665
';
6766

68-
$postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
67+
$postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d ORDER BY meta_key, meta_value ASC", $post->ID ) );
6968
foreach( $postmeta as $meta ) : if ( $meta->meta_key != '_edit_lock' ) :
7069
$output .= '
7170
<wp:postmeta>

0 commit comments

Comments
 (0)