-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix #53806 #1555
base: master
Are you sure you want to change the base?
Fix #53806 #1555
Conversation
@costdev, thank you for looking at this issue. It was brought to my attention by @cr0ybot in the comment WordPress/gutenberg#25188 (comment). I'm trying to confirm whether the documentation is incorrect or the implementation. The comment from @coreyworrell in the Trac ticket might be valid:
|
Great @gziolo! If a discussion about the documentation follows, I'd suggest that we maybe shouldn't force third party block developers to use a file ending in |
I located the PR in Gutenberg that added the handling which allows passing a full path (ending with Let me share some concerns I shared in another place regarding the name:
Regarding Plugins Directory, I'm talking about the automated section that lists blocks shipped with the plugin: |
@swissspidy, does the i18n command in WP-CLI detects only files named exactly @tellyworth, a similar question related to Plugin Directory and Block Directory. How much does the name of the block metadata file impact how all accompanying tools work today? I'm mostly curious if the name |
Right now it strictly looks for You mentioned that line in your above comment yourself though 😄 We could change the WP-CLI command to scan any JSON file though and then check every file whether it's a block file. That might slow down things a bit if you have tons of other JSON files, but would be the most convenient option. |
We need to make decision before WP 5.9 beta 1 release. It looks like updating the documentation makes the most sense here. We can always relax the requirement as proposed in the PR later. |
Providing
register_block_type_from_metadata
with the path to a custom named metadata file would search forpath/to/metadata_file.json/block.json
instead of correctly searching forpath/to/metadata_file.json
.The following check is now carried out:
$file_or_folder
path provided is a directory, search for$file_or_folder/block.json
.$file_or_folder
path exactly as provided.Trac ticket: https://core.trac.wordpress.org/ticket/53806
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.