Skip to content

Commit

Permalink
Template Part: Hide Advanced panel for non-admin users (WordPress#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 and bph committed Aug 31, 2024
1 parent 578200c commit e6f9e0b
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 e6f9e0b

Please sign in to comment.