Skip to content

Commit

Permalink
Add argument with post ID to the editor.savePost hook
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Oct 16, 2024
1 parent 6d84740 commit 4d00f18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/edit-post/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ export const initializeMetaBoxes =
addAction(
'editor.savePost',
'core/edit-post/save-metaboxes',
async ( options ) => {
async ( post, options ) => {
if ( ! options.isAutosave && select.hasMetaBoxes() ) {
await dispatch.requestMetaBoxUpdates();
}
Expand Down
6 changes: 5 additions & 1 deletion packages/editor/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,11 @@ export const savePost =

if ( ! error ) {
try {
await doActionAsync( 'editor.savePost', options );
await doActionAsync(
'editor.savePost',
{ id: previousRecord.id },
options
);
} catch ( err ) {
error = err;
}
Expand Down

0 comments on commit 4d00f18

Please sign in to comment.