wp_get_popular_importers example


);

get_current_screen()->set_help_sidebar(
    '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    '<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-import-screen/">Documentation on Import</a>' ) . '</p>' .
    '<p>' . __( '<a href="https://wordpress.org/support/forums">Support</a>' ) . '</p>'
);

if ( current_user_can( 'install_plugins' ) ) {
    // List of popular importer plugins from the WordPress.org API.     $popular_importers = wp_get_popular_importers();
} else {
    $popular_importers = array();
}

// Detect and redirect invalid importers like 'movabletype', which is registered as 'mt'. if ( ! empty( $_GET['invalid'] ) && isset( $popular_importers[ $_GET['invalid'] ] ) ) {
    $importer_id = $popular_importers[ $_GET['invalid'] ]['importer-id'];
    if ( $importer_id !== $_GET['invalid'] ) { // Prevent redirect loops.         wp_redirect( admin_url( 'admin.php?import=' . $importer_id ) );
        exit;
    }
    
Home | Imprint | This part of the site doesn't use cookies.