diff --git a/packages/editor/src/components/post-actions/actions.js b/packages/editor/src/components/post-actions/actions.js index d8da5cb51cf1d..e26bbd28222b6 100644 --- a/packages/editor/src/components/post-actions/actions.js +++ b/packages/editor/src/components/post-actions/actions.js @@ -68,6 +68,14 @@ export function usePostActions( { postType, onActionPerformed, context } ) { ); } + // Ensure "Move to trash" is always the last action. + actions = actions.sort( ( a, b ) => { + if ( b.id === 'move-to-trash' ) { + return -1; + } + return 0; + } ); + // Filter actions based on provided context. If not provided // all actions are returned. We'll have a single entry for getting the actions // and the consumer should provide the context to filter the actions, if needed.