Skip to content

Commit

Permalink
Remove trash button in post/page inspector (WordPress#61792)
Browse files Browse the repository at this point in the history
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: richtabor <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: jasmussen <[email protected]>
  • Loading branch information
7 people authored and carstingaxion committed Jun 4, 2024
1 parent 3915fca commit b52c415
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
13 changes: 0 additions & 13 deletions packages/editor/src/components/post-trash/panel.js

This file was deleted.

17 changes: 1 addition & 16 deletions packages/editor/src/components/sidebar/post-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,11 @@ import PostStatusPanel from '../post-status';
import PostStickyPanel from '../post-sticky';
import PostSyncStatus from '../post-sync-status';
import PostTemplatePanel from '../post-template/panel';
import PostTrashPanel from '../post-trash/panel';
import PostURLPanel from '../post-url/panel';
import BlogTitle from '../blog-title';
import PostsPerPage from '../posts-per-page';
import SiteDiscussion from '../site-discussion';
import { store as editorStore } from '../../store';
import {
NAVIGATION_POST_TYPE,
PATTERN_POST_TYPE,
TEMPLATE_PART_POST_TYPE,
TEMPLATE_POST_TYPE,
} from '../../store/constants';
import TemplateAreas from '../template-areas';

/**
Expand All @@ -43,7 +36,7 @@ import TemplateAreas from '../template-areas';
const PANEL_NAME = 'post-status';

export default function PostSummary( { onActionPerformed } ) {
const { isRemovedPostStatusPanel, postType } = useSelect( ( select ) => {
const { isRemovedPostStatusPanel } = useSelect( ( select ) => {
// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do
// not use isEditorPanelEnabled since this panel should not be disabled through the UI.
const { isEditorPanelRemoved, getCurrentPostType } =
Expand All @@ -53,10 +46,6 @@ export default function PostSummary( { onActionPerformed } ) {
postType: getCurrentPostType(),
};
}, [] );
const isPattern = postType === PATTERN_POST_TYPE;
const isTemplate = postType === TEMPLATE_POST_TYPE;
const isTemplatePart = postType === TEMPLATE_PART_POST_TYPE;
const isNavigation = postType === NAVIGATION_POST_TYPE;

return (
<PostPanelSection className="editor-post-summary">
Expand Down Expand Up @@ -95,10 +84,6 @@ export default function PostSummary( { onActionPerformed } ) {
<PostFormatPanel />
<TemplateAreas />
{ fills }
{ ! isPattern &&
! isTemplate &&
! isTemplatePart &&
! isNavigation && <PostTrashPanel /> }
</VStack>
) }
</VStack>
Expand Down

0 comments on commit b52c415

Please sign in to comment.