Skip to content

Commit

Permalink
Fix: Dont show pattern and template actions on the post editor. (Word…
Browse files Browse the repository at this point in the history
…Press#60568)

Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
  • Loading branch information
2 people authored and cbravobernal committed Apr 9, 2024
1 parent 5aef0c3 commit 213519f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/editor/src/components/post-actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import { moreVertical } from '@wordpress/icons';
import { unlock } from '../../lock-unlock';
import { usePostActions } from './actions';
import { store as editorStore } from '../../store';
import {
TEMPLATE_POST_TYPE,
TEMPLATE_PART_POST_TYPE,
PATTERN_POST_TYPE,
} from '../../store/constants';

const {
DropdownMenuV2: DropdownMenu,
Expand Down Expand Up @@ -71,6 +76,15 @@ export default function PostActions( { onActionPerformed } ) {
{ primaryActions: [], secondaryActions: [] }
);
}, [ actions, item ] );
if (
[
TEMPLATE_POST_TYPE,
TEMPLATE_PART_POST_TYPE,
PATTERN_POST_TYPE,
].includes( postType )
) {
return null;
}
return (
<DropdownMenu
trigger={
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/store/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ export const ONE_MINUTE_IN_MS = 60 * 1000;
export const AUTOSAVE_PROPERTIES = [ 'title', 'excerpt', 'content' ];
export const TEMPLATE_POST_TYPE = 'wp_template';
export const TEMPLATE_PART_POST_TYPE = 'wp_template_part';
export const PATTERN_POST_TYPE = 'wp_block';

0 comments on commit 213519f

Please sign in to comment.