Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds comment on blocks resource referencing wp_block post type. #62722

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading