Setting the file. One moment.
Skill 06 · Wp Block Development
Subchapter 6.8
references/registration.mdMarkdown932 BView on GitHub
Use this file when you need to register blocks robustly across repo types (plugin/theme/site).
Prefer:
register_block_type_from_metadata( $path_to_block_dir, $args = [] )Why:
block.json)render) and other metadata-driven fieldsUpstream reference:
init in the main plugin bootstrap or a dedicated loader.init (or after_setup_theme if you need theme supports first), but keep it predictable.If block.json includes render, ensure the file exists relative to the block root.
Inside the render file, use get_block_wrapper_attributes() for wrapper attributes.