You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking it might be useful to add a method to add data from a processed batch item to the array of batch items available in finish().
Inside finish we have the $this->items property which we can use to loop over the items that have been processed.
However it might be useful, whilst we are processing an item, to be able to update that batch-item in the $this->items array with data.
Use case:
Importing posts from a JSON file with meta-data.
When I create a post in process(), I could store the generated WP Post ID back into $this->items[>>currently-being-processed-item<<].
This would mean when I'm checking things in "finish()" I can quickly get access to the ID of the post created.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Brilliant plugin - so useful, thank you!
I was thinking it might be useful to add a method to add data from a processed batch item to the array of batch items available in finish().
Inside finish we have the $this->items property which we can use to loop over the items that have been processed.
However it might be useful, whilst we are processing an item, to be able to update that batch-item in the $this->items array with data.
Use case:
Thanks again,
Patrick
Beta Was this translation helpful? Give feedback.
All reactions