3 * Import WordPress Administration Panel
6 * @subpackage Administration
9 /** Load WordPress Bootstrap */
10 require_once ('admin.php');
11 $title = __('Import');
12 require_once ('admin-header.php');
13 $parent_file = 'tools.php';
17 <?php screen_icon(); ?>
18 <h2><?php echo esc_html( $title ); ?></h2>
19 <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>
23 // Load all importers so that they can register.
24 $import_loc = 'wp-admin/import';
25 $import_root = ABSPATH.$import_loc;
26 $imports_dir = @ opendir($import_root);
28 while (($file = readdir($imports_dir)) !== false) {
29 if ($file{0} == '.') {
31 } elseif (substr($file, -4) == '.php') {
32 require_once($import_root . '/' . $file);
36 @closedir($imports_dir);
38 $importers = get_importers();
40 if (empty ($importers)) {
41 echo '<p>'.__('No importers are available.').'</p>'; // TODO: make more helpful
44 <table class="widefat" cellspacing="0">
48 foreach ($importers as $id => $data) {
49 $style = ('class="alternate"' == $style || 'class="alternate active"' == $style) ? '' : 'alternate';
50 $action = "<a href='admin.php?import=$id' title='".wptexturize(strip_tags($data[1]))."'>{$data[0]}</a>";
53 $style = 'class="'.$style.'"';
56 <td class='import-system row-title'>$action</td>
57 <td class='desc'>{$data[1]}</td>
71 include ('admin-footer.php');