3 * Import WordPress Administration Panel
6 * @subpackage Administration
9 /** Load WordPress Bootstrap */
10 require_once ('admin.php');
12 if ( !current_user_can('edit_files') )
13 wp_die(__('You do not have sufficient permissions to import content in this blog.'));
15 $title = __('Import');
16 require_once ('admin-header.php');
17 $parent_file = 'tools.php';
21 <?php screen_icon(); ?>
22 <h2><?php echo esc_html( $title ); ?></h2>
23 <p><?php _e('If you have posts or comments in another system, WordPress can import those into this blog. To get started, choose a system to import from below:'); ?></p>
27 // Load all importers so that they can register.
28 $import_loc = 'wp-admin/import';
29 $import_root = ABSPATH.$import_loc;
30 $imports_dir = @ opendir($import_root);
32 while (($file = readdir($imports_dir)) !== false) {
33 if ($file{0} == '.') {
35 } elseif (substr($file, -4) == '.php') {
36 require_once($import_root . '/' . $file);
40 @closedir($imports_dir);
42 $importers = get_importers();
44 if (empty ($importers)) {
45 echo '<p>'.__('No importers are available.').'</p>'; // TODO: make more helpful
48 <table class="widefat" cellspacing="0">
52 foreach ($importers as $id => $data) {
53 $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate';
54 $action = "<a href='admin.php?import=$id' title='".wptexturize(strip_tags($data[1]))."'>{$data[0]}</a>";
57 $style = 'class="'.$style.'"';
60 <td class='import-system row-title'>$action</td>
61 <td class='desc'>{$data[1]}</td>
75 include ('admin-footer.php');