src/Import_Command.php
private function is_importer_available() {
		require_once ABSPATH . 'wp-admin/includes/plugin.php';

		if ( class_exists( 'WP_Import' ) ) {
			return true;
		}

		$plugins            = get_plugins();
		$wordpress_importer = 'wordpress-importer/wordpress-importer.php';
		if ( array_key_exists( $wordpress_importer, $plugins ) ) {
			$error_msg = "WordPress Importer needs to be activated. Try 'wp plugin activate wordpress-importer'.";
		} else {
			$error_msg = "WordPress Importer needs to be installed. Try 'wp plugin install wordpress-importer --activate'.";
		}

		return new WP_Error( 'importer-missing', $error_msg );
	}
private function is_importer_available() {
		require_once ABSPATH . 'wp-admin/includes/plugin.php';

		if ( class_exists( 'WP_Import' ) ) {
			return true;
		}

		$plugins            = get_plugins();
		$wordpress_importer = 'wordpress-importer/wordpress-importer.php';
		if ( array_key_exists( $wordpress_importer, $plugins ) ) {
			$error_msg = "WordPress Importer needs to be activated. Try 'wp plugin activate wordpress-importer'.";
		} else {
			$error_msg = "WordPress Importer needs to be installed. Try 'wp plugin install wordpress-importer --activate'.";
		}

		return new WP_Error( 'importer-missing', $error_msg );
	}
private function is_importer_available ( ) { require_once ABSPATH . 'wp-admin/includes/plugin.php' ; if ( class_exists ( 'WP_Import' ) ) { return true ; } $ plugins = get_plugins ( ) ; $ wordpress_importer = 'wordpress-importer/wordpress-importer.php' ; if ( array_key_exists ( $ wordpress_importer , $ plugins ) ) { $ error_msg = "WordPress Importer needs to be activated. Try 'wp plugin activate wordpress-importer'." ; } else { $ error_msg = "WordPress Importer needs to be installed. Try 'wp plugin install wordpress-importer --activate'." ; } return new WP_Error ( 'importer-missing' , $ error_msg ) ; }
Determines whether the requested importer is available.
Determines whether the requested importer is available .