-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Reusable blocks: Add UI for bulk deleting blocks #9588
Conversation
First pass at allowing reusable blocks to be edited via the edit.php?post_type=wp_block page.
?> | ||
<style type="text/css"> | ||
.page-title-action { | ||
display: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was chatting to @azaozz about this. In the medium term, we should patch Core to add a filter here:
https://github.com/WordPress/WordPress/blob/master/wp-admin/edit.php#L352
This would allow us to remove this hacky way of hiding the Add New button and improve how gutenberg_replace_default_add_new_button
works.
Thanks, this looks like a great start to me. It feels like we should add explanatory text to the cog button like "manage all blocks". cc @jasmussen @karmatosed |
This is great! Out of curiosity: How far away would the process be to be able to edit or add a new reusable block instead of just being able to trash it? |
In 6808783 I took the liberty of doing two things:
|
@slimmilkduds editing and adding should become more viable after the following refactor #7453 |
@jasmussen that border radius issue has been making me slightly crazy… thanks for that tweak :) |
Yep this works for me! Great work and really useful. |
className="editor-inserter__manage-reusable-blocks" | ||
icon="admin-generic" | ||
label={ __( 'Manage All Reusable Blocks' ) } | ||
href="edit.php?post_type=wp_block" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a later PR. We use links to target WP Admin pages (here, revisions, I'm probably missing other links too). The thing is. These links only work in WP context. We need to find a way to add these links in an "augmented" manner. Keeping the packages WP links free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, let's make sure we make an issue for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@@ -9,13 +9,14 @@ | |||
position: relative; | |||
overflow: hidden; | |||
text-indent: 4px; | |||
border-radius: $radius-round-rectangle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change make the following line redundant now (for .edit-post-header .components-button
selector)?
border-radius: $radius-round-rectangle; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I don't understand why it's IconButton which applies hover and active button styles (and the associated border radius), rather than the underlying Button ?
See related comment at #7534 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that makes this rule redundant.
And I don't have a good answer to your question, other than this is how we got to where we are today.
I very much appreciate the effort you are putting in #9702 — would you like help with that? Do you want to remove the redundant rule in the header as part of that PR, or would you like me to create a quick fixup here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created PR here: #10021
This addresses an issue reported in #9588 (comment). It also polishes the comments a bit.
* Remove redundant rule. This addresses an issue reported in #9588 (comment). It also polishes the comments a bit. * Address feedback.
Fixes #7387. First pass at allowing reusable blocks to be edited via
edit.php?post_type=wp_block
.