Skip to content

Commit

Permalink
Template Part: Hide Advanced panel for non-admin users (#64721)
Browse files Browse the repository at this point in the history
* Template Part: Hide Advanced panel for non-admin users

* Restore original conditional statement

Co-authored-by: t-hamano <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
3 people authored Aug 23, 2024
1 parent 8c4be58 commit 8ba6b11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export function TemplatePartAdvancedControls( {
} }
onFocus={ ( event ) => event.target.select() }
/>

<SelectControl
__next40pxDefaultSize
__nextHasNoMarginBottom
Expand Down
22 changes: 12 additions & 10 deletions packages/block-library/src/template-part/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,18 @@ export default function TemplatePartEdit( {
</ToolbarButton>
</BlockControls>
) }
<InspectorControls group="advanced">
<TemplatePartAdvancedControls
tagName={ tagName }
setAttributes={ setAttributes }
isEntityAvailable={ isEntityAvailable }
templatePartId={ templatePartId }
defaultWrapper={ areaObject.tagName }
hasInnerBlocks={ hasInnerBlocks }
/>
</InspectorControls>
{ canUserEdit && (
<InspectorControls group="advanced">
<TemplatePartAdvancedControls
tagName={ tagName }
setAttributes={ setAttributes }
isEntityAvailable={ isEntityAvailable }
templatePartId={ templatePartId }
defaultWrapper={ areaObject.tagName }
hasInnerBlocks={ hasInnerBlocks }
/>
</InspectorControls>
) }
{ isPlaceholder && (
<TagName { ...blockProps }>
<TemplatePartPlaceholder
Expand Down

0 comments on commit 8ba6b11

Please sign in to comment.