Skip to content
Docs
Get RestroPress

Action

rpress_import_item_saved

Updated
On this page

Fires after an imported menu item is saved.

Runs once per imported item, after the post, its meta, labels and image handling are done and the counters updated. Use it to copy extra source data onto the menu item.

Parameters#

ParameterTypeDescription
$post_idintMenu item (fooditem) post ID.
$itemarrayClean model item from the source adapter.
$job_idintImport ID.
$updatingboolTrue when an existing item was updated, false when created.

Example#

add_action( 'rpress_import_item_saved', 'my_import_item_saved', 10, 4 );
function my_import_item_saved( $post_id, $item, $job_id, $updating ) {
	if ( ! $updating ) {
		update_post_meta( $post_id, '_my_imported_from', (int) $job_id );
	}
}

Source#

Fired from:

  • includes/features/importer/class-rpress-importer-engine.php (line 954), in RPress_Importer_Engine::import_item()
Was this page helpful?