From 9a5d3d415519025fb7f1011a758361ad7eba6355 Mon Sep 17 00:00:00 2001 From: duck_ Date: Mon, 5 Sep 2011 19:18:36 +0000 Subject: [PATCH] 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 --- wp-admin/admin.php | 13 ++++--------- wp-admin/import.php | 22 ++-------------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/wp-admin/admin.php b/wp-admin/admin.php index ce1227d7d3..81d2c24fa2 100644 --- a/wp-admin/admin.php +++ b/wp-admin/admin.php @@ -183,13 +183,9 @@ if ( isset($plugin_page) ) { exit; } - // Allow plugins to define importers as well - 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 ) ); - exit; - } - include(ABSPATH . "wp-admin/import/$importer.php"); + if ( ! isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2]) ) { + wp_redirect( admin_url( 'import.php?invalid=' . $importer ) ); + exit; } $parent_file = 'tools.php'; @@ -211,8 +207,7 @@ if ( isset($plugin_page) ) { include(ABSPATH . 'wp-admin/admin-footer.php'); // Make sure rules are flushed - global $wp_rewrite; - $wp_rewrite->flush_rules(false); + flush_rewrite_rules(false); exit(); } else { diff --git a/wp-admin/import.php b/wp-admin/import.php index 774e547e1d..c2a1eb5a12 100644 --- a/wp-admin/import.php +++ b/wp-admin/import.php @@ -58,29 +58,11 @@ $parent_file = 'tools.php'; $pop_data ) { - if ( isset($importers[$pop_importer] ) ) + if ( isset( $importers[$pop_importer] ) ) continue; if ( isset( $pop_data[3] ) && isset( $importers[ $pop_data[3] ] ) ) continue; @@ -88,7 +70,7 @@ foreach ( $popular_importers as $pop_importer => $pop_data ) { $importers[$pop_importer] = $popular_importers[$pop_importer]; } -if (empty ($importers)) { +if ( empty($importers) ) { echo '

'.__('No importers are available.').'

'; // TODO: make more helpful } else { uasort($importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);'));