register_block_script_handle


register_block_script_handle ( $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 to register when multiple items passed. Default 0.
Returns:
  • (string|false) Script handle provided directly or created through script's registration, or false on failure.
Defined at:
Change Log:
  • 6: .
  • 6: .

Description

Finds a script handle 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 under automatically generated handle name. It returns unprocessed script handle otherwise.

Related Functions

register_block_style_handle, register_block_script_module_id, register_block_style, register_core_block_style_handles, register_block_core_file

Top Google Results

User discussions

wpseek mobile