excerpt_allowed_blocks WordPress Filter Hook

The excerpt_allowed_blocks hook is used to modify the list of blocks that are allowed in excerpts. This can be useful for creating custom excerpts that only include certain blocks, or for allowing certain blocks in excerpts that are normally not allowed.

apply_filters( 'excerpt_allowed_blocks', string[] $allowed_blocks ) #

Filters the list of blocks that can contribute to the excerpt.


Description

If a dynamic block is added to this list, it must not generate another excerpt, as this will cause an infinite loop to occur.


Top ↑

Parameters

$allowed_blocks

(string[])The list of names of allowed blocks.


Top ↑

Source

File: wp-includes/blocks.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.