Skip to content

Excerpt blocks don't respect the excerpt_length filter for user written excerpts #49612

@tomjn

Description

@tomjn

Description

The post excerpt block does not respect the excerpt_length filter in local tests on WordPress v6.2.

Step-by-step reproduction instructions

Attempt to shorten an excerpt using excerpt_length with a filter such as this:

E.g.:

function mytheme_custom_excerpt_length( $length ) {
    return 2;
}
add_filter( 'excerpt_length', 'mytheme_custom_excerpt_length', 999 );

The excerpts in block themes should now be 2 words long but instead they are unchanged for excerpts that are manually set. This was not the case when using the_excerpt() in classic themes.

Environment info

WordPress v6.2, the gutenberg plugin is inactive

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions