Make WordPress Core

Opened 4 weeks ago

Closed 10 days ago

Last modified 10 days ago

#53247 closed task (blessed) (fixed)

Block Editor: Include the Site Logo block from the Gutenberg repository

Reported by: youknowriad Owned by: youknowriad
Milestone: 5.8 Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-patch
Focuses: Cc:


Gutenberg 10.7 includes a Site Logo block that requires some updates to the settings endpoint to work properly. For this reason it has been left out of the package update commit.

Change History (16)

This ticket was mentioned in PR #1275 on WordPress/wordpress-develop by aristath.

4 weeks ago

  • Keywords has-patch added

#2 @prbot
4 weeks ago

youknowriad commented on PR #1275:

Can we enable the site-logo block in the same patch and add the required code? (I think to do so, there's a couple PHP files/webpack config to change and run npm run build:dev)

#4 @prbot
4 weeks ago

aristath commented on PR #1275:

Thank you @youknowriad :+1:
Added the block and fixed a related phpunit test.

#5 @prbot
4 weeks ago

youknowriad commented on PR #1275:

@aristath looks like there are some failing phpunit tests here, any idea?

#6 @prbot
3 weeks ago

aristath commented on PR #1275:

Fixed the failing tests

#7 @prbot
3 weeks ago

TimothyBJacobs commented on PR #1275:

At a minimum the name for the theme mods option in the REST API should just be theme_mods. It also should be using set_theme_mod and probably get_theme_mod. But again, putting that in this endpoint is entirely incorrect. The capability is incorrect, it is using manage_options instead of edit_theme_options and conceptually is a mismatch as the theme mods API is an abstraction over the options API.

Theme mods should either be added to the themes endpoint, or more ideally have an endpoint to interact with registered settings in the customizer.

This is not suitable to be shipped in Core. If you aren't interested in making those endpoints, then I'd recommend looking at calling the customizer admin-ajax API. Ex: https://github.com/WordPress/gutenberg/blob/854a31f3edee98e8b16ef5f2d32abcdaa8b395b0/packages/edit-navigation/src/store/actions.js#L195

This also seems to have a different change of adding the stylesheet option to the settings endpoint. I'm not sure why this is here, but it can't ship. If you need the active theme get it from the themes endpoint. If you need to change themes, you can't just do that by updating the option. Theme switching needs to be added to the themes endpoint.

#8 @prbot
3 weeks ago

aristath commented on PR #1275:

For the sake of this PR I updated @wordpress/block-library to v3.2.2, cleaned-up previous files and updated the ones relevant to the site-logo block.
Tests are currently failing, but it _should_ be OK once the block-library package gets updated in the master branch and this gets rebased.

#9 @prbot
2 weeks ago

youknowriad commented on PR #1275:

Packages are now up to date on trunk, would you mind refreshing this PR?

#10 @prbot
2 weeks ago

youknowriad commented on PR #1275:

The block seems to work in my testing. Any idea about the failing tests? Is it still the action unhooking thing?

#11 @prbot
2 weeks ago

aristath commented on PR #1275:

looking into the failing tests now :+1:

#12 @prbot
2 weeks ago

aristath commented on PR #1275:

All tests now pass. I needed to tweak the sync hook a bit, and a PR backporting these changes to Gutenberg was submitted in https://github.com/WordPress/gutenberg/pull/32370

#13 @prbot
2 weeks ago

youknowriad commented on PR #1275:

Ok makes sense. I guess this means we should wait for the next package update to land this PR to avoid having npm run build override your changes.

#14 @prbot
11 days ago

aristath commented on PR #1275:

Updated, should be OK to merge now :+1:

#15 @youknowriad
10 days ago

  • Owner set to youknowriad
  • Resolution set to fixed
  • Status changed from new to closed

In 51091:

Block Editor: Add the Site Logo block's server implementation.

Props aristath, timothyblynjacobs, ocean90.
Fixes #53247.

Note: See TracTickets for help on using tickets.