Action
rpress_import_item_saved
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#
| Parameter | Type | Description |
|---|---|---|
$post_id | int | Menu item (fooditem) post ID. |
$item | array | Clean model item from the source adapter. |
$job_id | int | Import ID. |
$updating | bool | True 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), inRPress_Importer_Engine::import_item()
Was this page helpful?
