W3cubDocs

/WordPress

register_importer( string $id, string $name, string $description, callable $callback ): void|WP_Error

Registers importer for WordPress.

Parameters

$idstringrequired
Importer tag. Used to uniquely identify importer.
$namestringrequired
Importer name and title.
$descriptionstringrequired
Importer description.
$callbackcallablerequired
Callback to run.

Return

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

Source

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

Changelog

Version Description
2.0.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/register_importer