editPost without undo entry

Yes, editPost is a wrapper around editEntityRecord which according to the core/data docs takes an options object that supports undoIgnore:

  • options Object: Options for the edit.
  • options.undoIgnore [boolean]: Whether to ignore the edit in undo history or not.

While you could use this, generally the need to use it implies a mistake or misunderstanding somewhere, or that the draft status is being set too late and should be set earlier.

A Warning: Editing vs Saving

Using editPost and editEntityRecord to set your post status to draft might not edit the database, it just changes the block editors internal state. It still needs to be saved/published to take effect.

This is why we have a saveEntityRecord function too, and it’s how the editor knows what posts/templates to list in the checkbox list when you click publish ( e.g. it’ll prompt if you want to update nav menus and synced templates etc )

For this reason, you might want to keep the undo/redo record.

deneme bonusudeneme bonusu veren sitelerpulibet girişOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casino