apply_filters( 'block_core_breadcrumbs_items', array[] $breadcrumb_items )
- Since
- 7.0.0
Filters the breadcrumb items array before rendering.
Description
Allows developers to modify, add, or remove breadcrumb items.
Compatibility
- WordPress
- since 7.0.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in 2 of the 5 tracked releases, added in 7.0.0.
Parameters
$breadcrumb_itemsarray[]- { Array of breadcrumb item data.
@type string $label The breadcrumb text.
@type string $url Optional. The breadcrumb link URL.
@type bool $allow_html Optional. Whether to allow HTML in the label.
When true, the label will be sanitized with wp_kses_post(), allowing only safe HTML tags. When false or omitted, all HTML will be escaped with esc_html(). Default false.
}$labelstringThe breadcrumb text.$urlstringOptional. The breadcrumb link URL.$allow_htmlboolOptional. Whether to allow HTML in the label. When true, the label will be sanitized with wp_kses_post(), allowing only safe HTML tags. When false or omitted, all HTML will be escaped with esc_html(). Default false.
Where this hook fires · 1
wp-includes/blocks/breadcrumbs.php:180render_block_core_breadcrumbs()
Source code
* @type bool $allow_html Optional. Whether to allow HTML in the label. * When true, the label will be sanitized with wp_kses_post(), * allowing only safe HTML tags. When false or omitted, all HTML * will be escaped with esc_html(). Default false. * } */ $breadcrumb_items = apply_filters( 'block_core_breadcrumbs_items', $breadcrumb_items ); if ( empty( $breadcrumb_items ) ) { return ''; } $wrapper_attributes = get_block_wrapper_attributes(Changelog
Introduced in 7.0.0. Unchanged from 7.0.4 through 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.