Skip to content
Docs
Get RestroPress

Action

rpress_register_import_sources

Updated
On this page

Fires once to let add-ons register import sources.

Runs the first time the sources are requested after init. Call rpress_register_import_source() from a callback to add a source to the Switch to RestroPress screen. Core registers its own CSV, GloriaFood and WooCommerce sources on this action at priority 5.

Available since RestroPress 3.5.

Example#

add_action( 'rpress_register_import_sources', 'my_register_import_source' );
function my_register_import_source() {
	rpress_register_import_source( 'my-source', array(
		'label'       => __( 'My source', 'my-plugin' ),
		'description' => __( 'Import from my system.', 'my-plugin' ),
		'accepts'     => array( 'json' ),
		'parse'       => 'my_parse_import_file',
	) );
}

Source#

Fired from:

  • includes/features/importer/loader.php (line 118), in rpress_get_import_sources()

See also#

Was this page helpful?