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.
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. |
This function needs to be called inside the
admin_init(orinit) action, otherwise it will sometimes cause a Fatal Error.