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

Examples of using the new filter blockEditor.useSetting.before #85

Closed
bph opened this issue Mar 2, 2023 Discussed in #38 · 15 comments
Closed

Examples of using the new filter blockEditor.useSetting.before #85

bph opened this issue Mar 2, 2023 Discussed in #38 · 15 comments
Assignees

Comments

@bph
Copy link
Collaborator

bph commented Mar 2, 2023

Discussed in #38

Originally posted by annezazu December 8, 2022
Pulled from this PR: WordPress/gutenberg#45089 This would be a great filter to highlight, especially when thinking about additional curation options with the block editor.

This allows the injection of block settings into the block editor before everything is rendered, so we are able to customize the settings available for a block however we want.

This unlocks a ton of neat options but definitely needs to be explained in detail and documented in general.

@ndiego
Copy link
Member

ndiego commented Mar 2, 2023

Thanks @bph I'll pick this up.

@cbirdsong
Copy link

cbirdsong commented Apr 4, 2023

Here are some examples of stuff that I haven't been able to figure out that seem like they should be possible with this?

  • Defaulting the "Inner blocks use content width" toggle switch to off when a new group block is added
  • Defaulting the "table has header row" toggle switch to on when a new table block is added
  • Removing the custom content width/wide width fields within the layout panel
  • Removing the layout panel entirely

(If these aren't possible then I guess that's another thing to clarify?)

@ndiego
Copy link
Member

ndiego commented Apr 4, 2023

Thanks @cbirdsong, I am going to start diving into this next week.

@bph
Copy link
Collaborator Author

bph commented Apr 5, 2023

Notes from the Editorial meeting March 2.

Share examples of using the new filter blockEditor.useSetting.before (#38) (title of the discussion, not working title yet) -> agreement in principle for idea, further discussion to follow

  • @bph: there will be a Dev Note about this new filter hook and this would be a follow-up post to give people more examples and use cases
  • alternative titles to be added to the ticket. @marybaum to work with @ndiego and @greenshady on options

@bph bph moved this from To-do to In Progress in Developer Blog Content Board May 4, 2023
@bph bph moved this from In Progress to To-do in Developer Blog Content Board May 4, 2023
@bph bph moved this from To-do to In Progress in Developer Blog Content Board May 4, 2023
@ndiego
Copy link
Member

ndiego commented May 20, 2023

The first draft of the article is ready for review: https://docs.google.com/document/d/1ktyuo4BHOeN3YzIpgoR83tmFGFTZIviKpC-NG2oabpA/edit#

@marybaum
Copy link
Member

On it!

@marybaum
Copy link
Member

Done!

@ndiego
Copy link
Member

ndiego commented May 21, 2023

Thanks for all your help @marybaum 🙏

@ndiego
Copy link
Member

ndiego commented May 21, 2023

The draft has been updated based on @marybaum's edits. @ingeniumed @alecgeatches @ryanwelcher @mburridge if you have time, I would greatly appreciate a technical review. This will be the first real article on the new blockEditor.useSetting.before filter so I want to make sure I am showcasing it well. 🙏

The code is all available via a companion plugin. I would like to keep the functionality of the examples the same if possible so I don't have to update the graphics, but any suggestions for improvement would be most welcome. Thanks!

@mburridge
Copy link

Excellent article. I just added a couple of minor comments.

@ndiego ndiego added flow: needs review reviewer wanted and removed flow: needs input let's discuss this. labels May 22, 2023
@ndiego ndiego moved this from In Progress to Needs 2nd review in Developer Blog Content Board May 22, 2023
@bph
Copy link
Collaborator Author

bph commented May 22, 2023

After the 2nd review is done on the blog draft, here is the Pre-publish checklist @ndiego

  • Post Title in Sentence case
  • Are Category or Categories selected?
  • Are Tags identifies?
  • Is there an explicit Excerpt?
  • Props added?
    🙌 Publish! 📗
  • add Props for reviews to #props channel in WP Slack

@alecgeatches
Copy link

@ndiego @marybaum @mburridge Fantastic article! I left a couple of very minor suggestions. I also left a comment chain about possible performance issues with expensive operations in blockEditor.useSetting.before, but after some testing I was incorrect about the cost of the example code and it's fine.

Thank you for writing up this awesome guide.

@ndiego
Copy link
Member

ndiego commented May 22, 2023

Thanks for the review @alecgeatches 🙏

@ingeniumed
Copy link

@ndiego @marybaum @mburridge Great article! I love the practical examples that have been provided along with screenshots of them in action. No suggestions from my end, as it looks great. 🚢

@ndiego
Copy link
Member

ndiego commented May 24, 2023

@ndiego ndiego closed this as completed May 24, 2023
@github-project-automation github-project-automation bot moved this from Needs 2nd review to Ready to publish in Developer Blog Content Board May 24, 2023
@bph bph moved this from Ready to publish to Published (Done) in Developer Blog Content Board Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Published (Done)
Development

No branches or pull requests

7 participants