Skip to content

Commit

Permalink
Do not show trash status
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Aug 12, 2024
1 parent 86d1571 commit 5bfb7dd
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/edit-site/src/components/post-edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,22 @@ function PostEditForm( { postType, postId } ) {
);
const [ multiEdits, setMultiEdits ] = useState( {} );
const { editEntityRecord } = useDispatch( coreDataStore );
const { fields } = usePostFields();
const { fields: _fields } = usePostFields();
const fields = useMemo(
() =>
_fields?.map( ( field ) => {
if ( field.id === 'status' ) {
return {
...field,
elements: field.elements.filter(
( element ) => element.value !== 'trash'
),
};
}
return field;
} ),
[ _fields ]
);
const form = {
type: 'panel',
fields: [ 'title', 'author', 'date', 'comment_status', 'status' ],
Expand Down

0 comments on commit 5bfb7dd

Please sign in to comment.