Match up plugin slugs with importer slugs when checking if they're installed. They're different for MT and wpcat2tag currently. see #13566

git-svn-id: https://develop.svn.wordpress.org/trunk@14968 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-05-27 00:32:01 +00:00
parent c510c0d0a6
commit 7dfa8b6bf6
1 changed files with 6 additions and 3 deletions

View File

@ -54,9 +54,9 @@ $popular_importers = array();
if ( current_user_can('install_plugins') )
$popular_importers = array(
'blogger' => array( __('Blogger'), __('Install the Blogger importer to import posts, comments, and users from a Blogger blog.'), 'install' ),
'wpcat2tag' => array(__('Categories and Tags Converter'), __('Install the category/tag converter to convert existing categories to tags or tags to categories, selectively.'), 'install'),
'wpcat2tag' => array(__('Categories and Tags Converter'), __('Install the category/tag converter to convert existing categories to tags or tags to categories, selectively.'), 'install', 'wp-cat2tag' ),
'livejournal' => array( __( 'LiveJournal' ), __( 'Install the LiveJournal importer to import posts from LiveJournal using their API.' ), 'install' ),
'movabletype' => array( __('Movable Type and TypePad'), __('Install the Movable Type importer to import posts and comments from a Movable Type or TypePad blog.'), 'install' ),
'movabletype' => array( __('Movable Type and TypePad'), __('Install the Movable Type importer to import posts and comments from a Movable Type or TypePad blog.'), 'install', 'mt' ),
'opml' => array( __('Blogroll'), __('Install the blogroll importer to import links in OPML format.'), 'install' ),
'rss' => array( __('RSS'), __('Install the RSS importer to import posts from an RSS feed.'), 'install' ),
'wordpress' => array( 'WordPress', __('Install the WordPress importer to import posts, pages, comments, custom fields, categories, and tags from a WordPress export file.'), 'install' )
@ -65,9 +65,12 @@ if ( current_user_can('install_plugins') )
$importers = get_importers();
// If a popular importer is not registered, create a dummy registration that links to the plugin installer.
foreach ( array_keys($popular_importers) as $pop_importer ) {
foreach ( $popular_importers as $pop_importer => $pop_data ) {
if ( isset($importers[$pop_importer] ) )
continue;
var_dump( $pop_data );
if ( isset( $pop_data[3] ) && isset( $importers[ $pop_data[3] ] ) )
continue;
$importers[$pop_importer] = $popular_importers[$pop_importer];
}