| 1 |
<?php |
| 2 |
global $wp_version; |
| 3 |
$xml_data = '<?xml version="1.0" encoding="UTF-8" ?>'; |
| 4 |
$xml_data .= sprintf( '<!-- generator="WordPress/%s" created="%s" -->', $wp_version, date( 'Y-m-d H:i:s' ) ); |
| 5 |
$xml_data .= '<rss version="2.0" |
| 6 |
xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/" |
| 7 |
xmlns:content="http://purl.org/rss/1.0/modules/content/" |
| 8 |
xmlns:wfw="http://wellformedweb.org/CommentAPI/" |
| 9 |
xmlns:dc="http://purl.org/dc/elements/1.1/" |
| 10 |
xmlns:wp="http://wordpress.org/export/1.2/" |
| 11 |
>'; |
| 12 |
|
| 13 |
$xml_data .= '<channel>'; |
| 14 |
|
| 15 |
$xml_data .= '<title>assistant</title>'; |
| 16 |
$xml_data .= '<link>' . get_bloginfo( 'url' ) . '</link>'; |
| 17 |
$xml_data .= '<description>' . get_bloginfo( 'description' ) . '</description>'; |
| 18 |
$xml_data .= '<pubDate>' . $data['post']->post_date_gmt . '</pubDate>'; |
| 19 |
$xml_data .= '<language>' . get_locale() . '</language>'; |
| 20 |
$xml_data .= '<wp:wxr_version>1.2</wp:wxr_version>'; |
| 21 |
$xml_data .= '<wp:base_site_url>' . get_bloginfo( 'url' ) . '</wp:base_site_url>'; |
| 22 |
$xml_data .= '<wp:base_blog_url>' . get_bloginfo( 'url' ) . '</wp:base_blog_url>'; |
| 23 |
|
| 24 |
$xml_data .= '<wp:author> |
| 25 |
<wp:author_id>' . $data['post']->post_author . '</wp:author_id> |
| 26 |
<wp:author_login><![CDATA[' . get_the_author_meta( 'user_login', $data['post']->post_author ) . ']]></wp:author_login> |
| 27 |
<wp:author_email><![CDATA[' . get_the_author_meta( 'user_email', $data['post']->post_author ) . ']]></wp:author_email> |
| 28 |
<wp:author_display_name><![CDATA[' . get_the_author_meta( 'display_name', $data['post']->post_author ) . ']]></wp:author_display_name> |
| 29 |
<wp:author_first_name><![CDATA[' . get_the_author_meta( 'user_firstname', $data['post']->post_author ) . ']]></wp:author_first_name> |
| 30 |
<wp:author_last_name><![CDATA[' . get_the_author_meta( 'user_lastname', $data['post']->post_author ) . ']]></wp:author_last_name> |
| 31 |
</wp:author>'; |
| 32 |
|
| 33 |
|
| 34 |
$xml_data .= '<generator>https://wordpress.org</generator>'; |
| 35 |
$xml_data .= '<item>'; |
| 36 |
$xml_data .= '<title>' . $data['post']->post_title . '</title>'; |
| 37 |
|
| 38 |
|
| 39 |
$xml_data .= '<pubDate>' . $data['post']->post_date . '</pubDate> |
| 40 |
<dc:creator>' . $data['author_name'] . '</dc:creator> |
| 41 |
<guid isPermaLink="false">' . $data['post']->guid . '</guid> |
| 42 |
<description></description> |
| 43 |
<content:encoded>' . $data['post_content'] . '</content:encoded> |
| 44 |
<excerpt:encoded>' . $data['post_excerpt'] . '</excerpt:encoded> |
| 45 |
<wp:post_id> ' . $data['post']->ID . '</wp:post_id> |
| 46 |
<wp:post_date>' . $data['post_date'] . '</wp:post_date> |
| 47 |
<wp:post_date_gmt>' . $data['post_date_gmt'] . '</wp:post_date_gmt> |
| 48 |
<wp:comment_status>' . $data['comment_status'] . '</wp:comment_status> |
| 49 |
<wp:ping_status>' . $data['ping_status'] . '</wp:ping_status> |
| 50 |
<wp:post_name>' . $data['post_title'] . '</wp:post_name> |
| 51 |
<wp:status>' . $data['post_status'] . '</wp:status> |
| 52 |
<wp:post_parent> ' . $data['post']->post_parent . '</wp:post_parent> |
| 53 |
<wp:menu_order> ' . $data['post']->menu_order . '</wp:menu_order> |
| 54 |
<wp:post_type>' . $data['post_type'] . '</wp:post_type> |
| 55 |
<wp:post_password></wp:post_password> |
| 56 |
<wp:is_sticky>0</wp:is_sticky>' . $data['taxonomy_data'] . $data['comment_data'] . $data['meta_data'] . '</item> |
| 57 |
</channel> |
| 58 |
</rss>'; |
| 59 |
|
| 60 |
echo $xml_data; |
| 61 |
|