Making WordPress.org

Opened 15 months ago

Last modified 5 months ago

#6611 new defect (bug)

Template part block hooks missing from Code Reference

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Priority: normal
Component: Developer Hub Keywords:
Cc:

Description

The following hooks are missing from the Code Reference:

  • render_block_core_template_part_post
  • render_block_core_template_part_file
  • render_block_core_template_part_none

Ref: https://github.com/WordPress/wordpress-develop/blob/a9afc8e36bf669ea1b5a5cb79602aae4e0ec613a/src/wp-includes/blocks/template-part.php#L63-L101

Change History (4)

#1 @coffee2code
15 months ago

After [9184], per #4624, wp-includes/blocks/ is explicitly excluded from the Code Reference as that code was considered an external package. The hooks listed above are defined in wp-includes/blocks/template-parts.php.

Exclusion is via https://github.com/WordPress/wporg-developer/blob/trunk/source/wp-content/themes/wporg-developer/inc/parser.php#L24

Does Core consider this file to be an exclusion to that rule?

#2 @johnbillion
15 months ago

I'm not sure if anything has changed since then but the @since tags on those actions appear to represent the WordPress version they were introduced in (5.9.0), rather than the Gutenberg version.

#3 @dd32
15 months ago

Personal opinion, wp-includes/blocks should be included in the reference, in full, as it's not an "external project" as such, even if it's primarily developed within Gutenberg.

Of the files in that directory, https://github.com/WordPress/wordpress-develop/blob/a9afc8e36bf669ea1b5a5cb79602aae4e0ec613a/src/wp-includes/blocks/latest-comments.php#L23 is the only instance of an @since where the version appears to be incorrect (3.3) which should be corrected to be a WordPress version (if it's not WP3.3)

#4 @emrikol
5 months ago

I'm in agreement with @dd32, as I've just finished an embarrassingly long dive into trying to figure out what was going on with the docs.

The block editor is a core part of WordPress now, and once features, functions, hooks, etc get merged into core their documentation should be a part of it.

We already include everything in wp-includes/blocks.php so it seems to make sense to me to include wp-includes/blocks/* as well.

Note: See TracTickets for help on using tickets.