register_importer() WordPress Function

The register_importer() function is used to register importers for use with the WordPress Import plugin. This function should be called in the init action.

register_importer( string $id, string $name, string $description, callable $callback ) #

Register importer for WordPress.


Parameters

$id

(string)(Required)Importer tag. Used to uniquely identify importer.

$name

(string)(Required)Importer name and title.

$description

(string)(Required)Importer description.

$callback

(callable)(Required)Callback to run.


Top ↑

Return

(void|WP_Error) Void on success. WP_Error when $callback is WP_Error.


Top ↑

Source

File: wp-admin/includes/import.php

function register_importer( $id, $name, $description, $callback ) {
	global $wp_importers;
	if ( is_wp_error( $callback ) ) {
		return $callback;
	}
	$wp_importers[ $id ] = array( $name, $description, $callback );
}


Top ↑

Changelog

Changelog
VersionDescription
2.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.