#49348 closed defect (bug) (fixed)
Block Editor: Include navigation block php file
Reported by: | jorgefilipecosta | Owned by: | jorgefilipecosta |
---|---|---|---|
Milestone: | 5.4 | Priority: | normal |
Severity: | normal | Version: | 5.4 |
Component: | Editor | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Currently, the core does not include the navigation block PHP files.
That happens because we missed changing the core files to copy the PHP file from npm and to include the file.
This PR fixes the issue referred, and now the navigation block is executed on the frontend. The block still does not work as expected and throws an error during frontend execution. A PR to fix this issue is available on the block editor side at https://github.com/WordPress/gutenberg/pull/19991/.
I tried this code replacing the navigation.php file with the one proposed on the PR and verified the block works as expected.
This patch adds the file as it is on the last version of the npm package. With the patch committed on the next package update, the navigation block will work as expected.
cc: @andraganescu
Attachments (3)
Change History (10)
This ticket was mentioned in PR #145 on WordPress/wordpress-develop by jorgefilipecosta.
5 years ago
#1
#3
@
5 years ago
- Owner set to jorgefilipecosta
- Resolution set to fixed
- Status changed from new to closed
In 47176:
#4
@
5 years ago
Should these function names be more specific? Or are they general utilities functions that should live somewhere else?
Thinking specifically about build_css_colors
and build_css_font_sizes
.
#6
@
5 years ago
Hi @TimothyBlynJacobs, thank you for raising this point.
Here we are just including the navigation block as it is in the Gutenberg plugin, but I think these functions are very specific and should be renamed in the plugin (the change will propagate to core on the next package update).
#7
@
5 years ago
Regarding the two functions mentioned by @TimothyBlynJacobs build_css_colors
and build_css_font_sizes
these are needed to extract color and font size CSS class / data because the block is using the new colors and fonts hooks.
While working on adding features to the PostAuthor
block I have also needed the same functions and, for reasons of moving the PR ahead, just copied them, see the GitHub issue 19894
What would the solution be to have these as reusable code? Should we?
I tested this patch and everything works as expected. I was able to insert Navigation block and apply some basic modifications. Code also looks correct!