-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Closed
Copy link
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress
Description
Description
In packages/block-library/src/navigation-link/index.php at line 488, add_action() is used to register a callback on the get_block_type_variations hook:
add_action( 'get_block_type_variations', 'block_core_navigation_link_filter_variations', 10, 2 );However, this hook is fired with apply_filters() in wp-includes/class-wp-block-type.php:616, making it a filter — not an action.
Gutenberg's own documentation already shows the correct usage (docs/reference-guides/block-api/block-variations.md:90):
add_filter( 'get_block_type_variations', 'my_custom_image_variation', 10, 2 );Step-by-step reproduction
N/A — functionally equivalent since add_action() calls add_filter() internally, but semantically incorrect.
Expected behavior
Should use add_filter() to match the hook type.
Current behavior
Uses add_action() for a hook fired via apply_filters().
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Status] In ProgressTracking issues with work in progressTracking issues with work in progress