2006-10-25 18:55:05 -04:00
< ? php
2008-08-11 16:26:31 -04:00
/**
* WordPress Export Administration Panel
*
* @ package WordPress
* @ subpackage Administration
*/
/** Load WordPress Bootstrap */
2006-10-25 18:55:05 -04:00
require_once ( 'admin.php' );
2008-08-11 16:26:31 -04:00
2009-08-01 22:23:54 -04:00
if ( ! current_user_can ( 'edit_files' ) )
wp_die ( __ ( 'You do not have sufficient permissions to export the content of this blog.' ));
2008-08-11 16:26:31 -04:00
/** Load WordPress export API */
2007-11-15 00:32:33 -05:00
require_once ( 'includes/export.php' );
2006-11-18 02:31:29 -05:00
$title = __ ( 'Export' );
2006-10-25 18:55:05 -04:00
2008-02-05 01:47:27 -05:00
if ( isset ( $_GET [ 'download' ] ) ) {
2008-10-21 19:54:18 -04:00
$author = isset ( $_GET [ 'author' ]) ? $_GET [ 'author' ] : 'all' ;
export_wp ( $author );
2007-11-15 00:32:33 -05:00
die ();
}
2006-10-25 18:55:05 -04:00
require_once ( 'admin-header.php' );
?>
< div class = " wrap " >
2008-11-26 08:51:25 -05:00
< ? php screen_icon (); ?>
2009-05-18 11:11:07 -04:00
< h2 >< ? php echo esc_html ( $title ); ?> </h2>
2008-10-17 16:02:03 -04:00
2006-12-05 02:15:12 -05:00
< p >< ? php _e ( 'When you click the button below WordPress will create an XML file for you to save to your computer.' ); ?> </p>
2008-03-09 18:14:49 -04:00
< p >< ? php _e ( 'This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.' ); ?> </p>
2006-12-26 19:51:00 -05:00
< p >< ? php _e ( 'Once you’ve saved the download file, you can use the Import function on another WordPress blog to import this blog.' ); ?> </p>
2006-10-25 18:55:05 -04:00
< form action = " " method = " get " >
2008-02-27 14:18:21 -05:00
< h3 >< ? php _e ( 'Options' ); ?> </h3>
2006-11-18 18:13:15 -05:00
2008-02-27 14:18:21 -05:00
< table class = " form-table " >
2006-11-18 18:13:15 -05:00
< tr >
2008-05-04 06:37:06 -04:00
< th >< label for = " author " >< ? php _e ( 'Restrict Author' ); ?> </label></th>
2006-11-18 18:13:15 -05:00
< td >
2008-05-04 06:37:06 -04:00
< select name = " author " id = " author " >
2008-02-13 19:57:29 -05:00
< option value = " all " selected = " selected " >< ? php _e ( 'All Authors' ); ?> </option>
2006-11-18 18:13:15 -05:00
< ? php
2007-08-21 14:27:45 -04:00
$authors = $wpdb -> get_col ( " SELECT post_author FROM $wpdb->posts GROUP BY post_author " );
2006-11-18 18:13:15 -05:00
foreach ( $authors as $id ) {
$o = get_userdata ( $id );
2009-05-05 15:43:53 -04:00
echo " <option value=' " . esc_attr ( $o -> ID ) . " '> $o->display_name </option> " ;
2006-11-18 18:13:15 -05:00
}
?>
</ select >
</ td >
</ tr >
</ table >
2009-05-05 15:43:53 -04:00
< p class = " submit " >< input type = " submit " name = " submit " class = " button " value = " <?php esc_attr_e('Download Export File'); ?> " />
2006-10-25 18:55:05 -04:00
< input type = " hidden " name = " download " value = " true " />
</ p >
</ form >
</ div >
< ? php
include ( 'admin-footer.php' );
2008-10-27 16:41:05 -04:00
?>