Skip to content

Commit

Permalink
Fix editor crash due to homepage action (WordPress#67500)
Browse files Browse the repository at this point in the history
Co-authored-by: Mayank-Tripathi32 <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: oandregal <[email protected]>
  • Loading branch information
4 people authored and im3dabasia committed Dec 4, 2024
1 parent c6a6e57 commit 9df19a8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/editor/src/components/post-actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@ export function usePostActions( { postType, onActionPerformed, context } ) {
}, [ registerPostTypeSchema, postType ] );

return useMemo( () => {
let actions = [
...defaultActions,
shouldShowSetAsHomepageAction ? setAsHomepageAction : [],
];
let actions = [ ...defaultActions ];
if ( shouldShowSetAsHomepageAction ) {
actions.push( setAsHomepageAction );
}

// 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.
Expand Down

0 comments on commit 9df19a8

Please sign in to comment.