Skip to content

Commit

Permalink
fix use old template panel if user doesn’t have access to view templa…
Browse files Browse the repository at this point in the history
…tes (#58485)
  • Loading branch information
fabiankaegy authored Jan 31, 2024
1 parent 30b3000 commit b8d31f2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/editor/src/components/post-template/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export default function PostTemplatePanel() {
return canCreateTemplates;
}, [] );

if ( ! isBlockTheme && isVisible ) {
const canViewTemplates = useSelect( ( select ) => {
return select( coreStore ).canUser( 'read', 'templates' ) ?? false;
}, [] );

if ( ( ! isBlockTheme || ! canViewTemplates ) && isVisible ) {
return (
<PostPanelRow label={ __( 'Template' ) }>
<ClassicThemeControl />
Expand Down

0 comments on commit b8d31f2

Please sign in to comment.