Pull out old import remnant from when importers were shipped in core. Fixes #15844.

git-svn-id: http://svn.automattic.com/wordpress/trunk@18640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
duck_ 2011-09-05 19:18:36 +00:00
parent 2f51b9be0d
commit 9a5d3d4155
2 changed files with 6 additions and 29 deletions

View File

@ -183,14 +183,10 @@ if ( isset($plugin_page) ) {
exit; exit;
} }
// Allow plugins to define importers as well if ( ! isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2]) ) {
if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2])) {
if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) {
wp_redirect( admin_url( 'import.php?invalid=' . $importer ) ); wp_redirect( admin_url( 'import.php?invalid=' . $importer ) );
exit; exit;
} }
include(ABSPATH . "wp-admin/import/$importer.php");
}
$parent_file = 'tools.php'; $parent_file = 'tools.php';
$submenu_file = 'import.php'; $submenu_file = 'import.php';
@ -211,8 +207,7 @@ if ( isset($plugin_page) ) {
include(ABSPATH . 'wp-admin/admin-footer.php'); include(ABSPATH . 'wp-admin/admin-footer.php');
// Make sure rules are flushed // Make sure rules are flushed
global $wp_rewrite; flush_rewrite_rules(false);
$wp_rewrite->flush_rules(false);
exit(); exit();
} else { } else {

View File

@ -58,24 +58,6 @@ $parent_file = 'tools.php';
<?php <?php
// Load all importers so that they can register.
$import_loc = 'wp-admin/import';
$import_root = ABSPATH . $import_loc;
if ( file_exists( $import_root ) ) {
$imports_dir = opendir($import_root);
if ($imports_dir) {
while (($file = readdir($imports_dir)) !== false) {
if ($file[0] == '.') {
continue;
} elseif (substr($file, -4) == '.php') {
require_once($import_root . '/' . $file);
}
}
}
closedir( $imports_dir );
}
$importers = get_importers(); $importers = get_importers();
// If a popular importer is not registered, create a dummy registration that links to the plugin installer. // If a popular importer is not registered, create a dummy registration that links to the plugin installer.