Skip to content

Commit

Permalink
Adds comment on blocks resource referencing wp_block post type.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Jun 21, 2024
1 parent bb73da7 commit 9e2f9dd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/edit-site/src/components/add-new-pattern/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default function AddNewPattern() {
?.add_new_item,
addNewTemplatePartLabel: getPostType( TEMPLATE_PART_POST_TYPE )
?.labels?.add_new_item,
// Blocks refers to the wp_block post type, this checks the ability to create a post of that type.
canCreatePattern: canUser( 'create', 'blocks' ),
canCreateTemplatePart: canUser( 'create', 'template-parts' ),
};
Expand Down
1 change: 1 addition & 0 deletions packages/patterns/src/components/pattern-convert-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default function PatternConvertButton( {
hasBlockSupport( block.name, 'reusable', true )
) &&
// Hide when current doesn't have permission to do that.
// Blocks refers to the wp_block post type, this checks the ability to create a post of that type.
!! canUser( 'create', 'blocks' );

return _canConvert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default function ReusableBlockConvertButton( {
hasBlockSupport( block.name, 'reusable', true )
) &&
// Hide when current doesn't have permission to do that.
// Blocks refers to the wp_block post type, this checks the ability to create a post of that type.
!! canUser( 'create', 'blocks' );

return _canConvert;
Expand Down

0 comments on commit 9e2f9dd

Please sign in to comment.