Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Excerpt limit is overruled (#48403) #48598

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions packages/block-library/src/post-excerpt/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ function register_block_core_post_excerpt() {
* the excerpt length block setting has no effect.
* Returns 100 because 100 is the max length in the setting.
*/
add_filter( 'excerpt_length', function( $length ) {
if ( is_admin() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {
return 100;
}
return $length;
}, PHP_INT_MAX );
add_filter(
'excerpt_length',
function( $length ) {
if ( is_admin() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {
return 100;
}
return $length;
},
PHP_INT_MAX
);