[wp-meta] [Making WordPress.org] #5971: Plugin Directory: Custom Block Names not being listed right
Making WordPress.org
noreply at wordpress.org
Wed Dec 1 23:26:20 UTC 2021
#5971: Plugin Directory: Custom Block Names not being listed right
------------------------------+---------------------
Reporter: Ipstenu | Owner: (none)
Type: defect | Status: new
Priority: normal | Milestone:
Component: Plugin Directory | Resolution:
Keywords: |
------------------------------+---------------------
Comment (by ryelle):
The `block.json` is the easiest way to get this info (since it's already
in a format we can parse and get the value from directly). The next best
way to get block titles is from the JS `registerBlockType` call (which is
working for OER Curriculum's "Curriculum Thumbnail Block" block), but this
is done with a regex, so it expects very specific formatting - the `title`
must be the first value in the config object, with no comments/etc before
it.
The script also checks PHP files for `register_block_type`, but it doesn't
even try to find a title.
([https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html
/wp-content/plugins/plugin-directory/cli/class-import.php#L747 code source
for finding blocks.])
Aside from improving that JS regex, what would be a better fallback? Maybe
human-ify the block name, so it would go from `ryelle/recipe` to "Ryelle
Recipe", `opinion-stage/block-os-poll` to "Opinion Stage Block Os Poll"?
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/5971#comment:1>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list