Make WordPress Core

Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#60460 closed enhancement (fixed)

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

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

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
16 months ago

  • Description modified (diff)

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


16 months ago
#2

  • Keywords has-patch has-unit-tests added

#4 @gziolo
16 months ago

  • Resolution set to fixed
  • Status changed from new to closed

@colorful tones commented on PR #5799:


16 months ago
#5

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

#6 @stevenlinx
16 months ago

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