Ticket #11118: export.patch
File export.patch, 2.0 KB (added by , 14 years ago) |
---|
-
export.
old new 14 14 * @since unknown 15 15 * @var string 16 16 */ 17 define('WXR_VERSION', '1. 0');17 define('WXR_VERSION', '1.1'); 18 18 19 19 /** 20 20 * {@internal Missing Short Description}} … … 212 212 echo $the_list; 213 213 } 214 214 215 /** 216 * Get list of blog authors 217 * 218 * @param mixed UserID or all 219 * @return array of user objects 220 */ 221 222 function wxr_get_authors( $author ) { 223 global $wpdb; 224 $users = array(); 225 226 if ( 'all' == $author) { 227 $user_ids = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" ); 228 foreach ( $user_ids as $id ) 229 $users[] = get_userdata( $id ); 230 } else { 231 $users[] = get_userdata( $author ); 232 } 233 234 return $users; 235 } 236 215 237 echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n"; 216 238 217 239 ?> … … 250 272 <wp:wxr_version><?php echo WXR_VERSION; ?></wp:wxr_version> 251 273 <wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url> 252 274 <wp:base_blog_url><?php bloginfo_rss('url'); ?></wp:base_blog_url> 275 276 <?php 277 $wp_users = wxr_get_authors( $author ); 278 ?> 279 <wp:users> 280 <?php foreach( $wp_users as $wp_user ) : ?> 281 <wp:user> 282 <wp:user_nicename><?php echo $wp_user->user_nicename; ?></wp:user_nicename> 283 <wp:user_email><?php echo $wp_user->user_email; ?></wp:user_email> 284 <wp:user_display_name><?php echo wxr_cdata( $wp_user->display_name ); ?></wp:user_display_name> 285 <wp:user_first_name><?php echo wxr_cdata( $wp_user->user_firstname ); ?></wp:user_first_name> 286 <wp:user_last_name><?php echo wxr_cdata( $wp_user->user_lastname ); ?></wp:user_last_name> 287 </wp:user> 288 <?php endforeach; ?> 289 </wp:users> 290 253 291 <?php if ( $cats ) : foreach ( $cats as $c ) : ?> 254 292 <wp:category><wp:category_nicename><?php echo $c->slug; ?></wp:category_nicename><wp:category_parent><?php echo $c->parent ? $cats[$c->parent]->name : ''; ?></wp:category_parent><?php wxr_cat_name($c); ?><?php wxr_category_description($c); ?></wp:category> 255 293 <?php endforeach; endif; ?>