Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#60460 closed enhancement (fixed)

Editor: Make asset registration .asset.php optional for blocks

Reported by: gziolo Owned by:
Priority: normal Milestone: 6.5
Component: Editor Version: 5.5
Severity: normal Keywords: has-patch has-unit-tests add-to-field-guide
Cc: Focuses:

Description (last modified by gziolo)

A related issue in Gutenberg: ​https://github.com/WordPress/gutenberg/issues/57234.

It is a hard requirement that a *.asset.php file is present to register a block in WordPress. Otherwise, it throws a Warning:

function register_block_script_handle was called incorrectly. The asset file (/wp-content/uploads/faustwp/blocks/block-a/index.asset.php) for the "editorScript" defined in "create-block/block-a" block definition is missing. (This message was added in version 5.5.0.)

and the block will not appear in the inserter.

Change History (6)

#1 @gziolo
3 years ago

  • Description modified (diff)

This ticket was mentioned in ​PR #5799 on ​WordPress/wordpress-develop by ​@JoeFusco.


3 years ago
#2

  • Keywords has-patch has-unit-tests added

#4 @gziolo
3 years ago

  • Resolution → fixed
  • Status new → closed

​@colorful tones commented on ​PR #5799:


3 years ago
#5

Thanks for getting this over the line @gziolo and thanks @josephfusco for kicking it off 🙌

#6 @stevenlinx
3 years ago

  • Keywords add-to-field-guide added
Note: See TracTickets for help on using tickets.