Make WordPress Core

Opened 2 years ago

Last modified 12 months ago

#55486 new defect (bug)

register_block_type_from_metadata does NOT work within a theme but as a plugin

Reported by: andre3600's profile andre3600 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 5.9.2
Component: General Keywords: needs-refresh
Focuses: Cc:

Description

I created a wordpress block and it guides me to the official documentation and it came to work as an external plugin, taking into account the architecture of block.json for its use, however it has not worked for me when the block is required to be integrated into a theme, delivery wrong path request looking in plugin folder plus adding another path.

example error peticion

https://domain.local/wp-content/plugins/D:/xampp/htdocs/wp-content/themes/NewsPaper/inc/gutenberg/myblock/index.js?ver=d395fe5d9d90bd6565685c91d8d38888

Change History (3)

#1 @jrf
2 years ago

  • Focuses coding-standards removed

#2 @joyously
2 years ago

I think this is working as designed, with the design being that themes should not supply blocks since they can be switched at any time, even programmatically.

#3 @wildworks
12 months ago

This issue was also reported in #54647, but by [53091] I believe the asset path is now resolved when the block is registered on the theme.

I think this ticket can be closed.

Note: See TracTickets for help on using tickets.