[wp-trac] [WordPress Trac] #59348: Excerpt block length is not full customizable any more
WordPress Trac
noreply at wordpress.org
Thu Sep 14 11:40:32 UTC 2023
#59348: Excerpt block length is not full customizable any more
-------------------------------+-----------------------------
Reporter: frzsombor | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version:
Severity: normal | Keywords:
Focuses: |
-------------------------------+-----------------------------
Since the latest changes in /src/wp-includes/blocks/post-excerpt.php now
the excerpt length is not fully customizable any more. The problem is that
previously `$excerpt = get_the_excerpt();` was used, which was filterable
with `get_the_excerpt`, but now this excerpt is just getting forcefully
trimmed by `wp_trim_words` based on the `excerptLength` option. Which is:
a) A number forced to be between 10-100 b) now can not be changed or
overwritted with custom code in any way.
If I want to display the excerpt of a post on the post's page, now there
is no way to correctly display an excerpt that is longer than 100 words. I
think this is a loss in features and a bad practice to limit the excerpt's
usage in this way. At least allow `$excerpt_length =
$attributes['excerptLength'];` to be modified with the already existing
`excerpt_length` filter.
Mentioned change:
https://core.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&new=56065%40trunk%2Fsrc
%2Fwp-includes%2Fblocks%2Fpost-excerpt.php&old=55246%40trunk%2Fsrc%2Fwp-
includes%2Fblocks%2Fpost-excerpt.php
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59348>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list