Skip to content

Commit

Permalink
Hide page list edit button if no pages available (WordPress#46331)
Browse files Browse the repository at this point in the history
* hides page list edit button if no pages avaulable

* Don't output BlockControls if there are no pages

Co-authored-by: Andrei Draganescu <github@andreidraganescu.info>
Co-authored-by: Ben Dwyer <ben@scruffian.com>
  • Loading branch information
3 people authored and mpkelly committed Dec 7, 2022
1 parent d22f1af commit 8ad19f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/page-list/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default function PageListEdit( {
/>
</PanelBody>
</InspectorControls>
{ allowConvertToLinks && (
{ allowConvertToLinks && totalPages > 0 && (
<BlockControls group="other">
<ToolbarButton title={ __( 'Edit' ) } onClick={ openModal }>
{ __( 'Edit' ) }
Expand Down

0 comments on commit 8ad19f8

Please sign in to comment.