wp_die( __( 'Sorry, you are not allowed to import content.' ) );
}
$title = __('Import');
get_current_screen()->add_help_tab( array(
'id' => 'overview',
'title' => __('Overview'),
'content' => '<p>' . __('This screen lists links to plugins to import data from blogging/content management platforms. Choose the platform you want to import from, and click Install Now when you are prompted in the popup window. If your platform is not listed, click the link to search the plugin directory for other importer plugins to see if there is one for your platform.') . '</p>' .
'<p>' . __('In previous versions of WordPress, all importers were built-in. They have been turned into plugins since most people only use them once or infrequently.') . '</p>',
) );
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="https://codex.wordpress.org/Tools_Import_Screen">Documentation on Import</a>') . '</p>' .
printf( __( 'The %s importer is invalid or is not installed.' ), '<strong>' . esc_html( $_GET['invalid'] ) . '</strong>' );
?></p>
</div>
<?php endif; ?>
<p><?php _e('If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:'); ?></p>
<?php
// Registered (already installed) importers. They're stored in the global $wp_importers.
$importers = get_importers();
// If a popular importer is not registered, create a dummy registration that links to the plugin installer.
foreach ( $popular_importers as $pop_importer => $pop_data ) {
if ( isset( $importers[ $pop_importer ] ) )
continue;
if ( isset( $importers[ $pop_data['importer-id'] ] ) )
continue;
// Fill the array of registered (already installed) importers with data of the popular importers from the WordPress.org API.
esc_attr( sprintf( __( 'More information about %s' ), $data[0] ) ),
__( 'Details' )
);
}
echo "
<tr class='importer-item'>
<td class='import-system'>
<span class='importer-title'>{$data[0]}</span>
<span class='importer-action'>{$action}</span>
</td>
<td class='desc'>
<span class='importer-desc'>{$data[1]}</span>
</td>
</tr>";
}
?>
</table>
<?php
}
if ( current_user_can('install_plugins') )
echo '<p>' . sprintf( __('If the importer you need is not listed, <a href="%s">search the plugin directory</a> to see if an importer is available.'), esc_url( network_admin_url( 'plugin-install.php?tab=search&type=tag&s=importer' ) ) ) . '</p>';