register_block_script_module_id


register_block_script_module_id ( $metadata, $field_name, $index = 0 )

Parameters:
  • (array) metadata Block metadata.
  • (string) field_name Field name to pick from metadata.
  • (int) index Optional. Index of the script module ID to register when multiple items passed. Default 0.
Returns:
  • (string|false) Script module ID or false on failure.
Defined at:

Description

Finds a script module ID for the selected block metadata field. It detects when a path to file was provided and optionally finds a corresponding asset file with details necessary to register the script module under with an automatically generated module ID. It returns unprocessed script module ID otherwise.

Related Functions

register_block_script_handle, wp_register_script_module, wp_deregister_script_module, register_block_style, register_block_core_file

Top Google Results

User discussions

wpseek mobile