Make WordPress Core

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#59504 closed defect (bug) (duplicate)

'excerpt_length' filter in hijacked for ajax requests

Reported by: perrelet's profile perrelet Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.3.2
Component: Editor Keywords: has-patch
Focuses: Cc:

Description

wp-include/blocks/post-excerpt.php:86

The file hooks 'excerpt_length' with a value of 100 and priority of PHP_INT_MAX for admin and rest requests. As a result, 'excerpt_length' is set to 100 for ajax requests (is_admin() is true for these)

Presumably this is incorrect. If a post is being rendered via ajax, it's excerpt length shouldn't be hijacked by block logic.

Change History (4)

This ticket was mentioned in PR #5354 on WordPress/wordpress-develop by perrelet.


5 months ago
#1

  • Keywords has-patch added

wp-include/blocks/post-excerpt.php:86

hooks excerpt_length with a value of 100 and priority of PHP_INT_MAX for admin and rest requests. As a result, excerpt_length is set to 100 for ajax requests (is_admin() is true for these)

Presumably this is incorrect. If a post is being rendered via ajax, it's excerpt length shouldn't be hijacked by block logic.

Trac ticket: (https://core.trac.wordpress.org/ticket/59504)

#2 @swissspidy
5 months ago

  • Component changed from General to Editor
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there

Thanks for your ticket & PR. We‘re already tracking this issue in #59043

#3 @perrelet
5 months ago

@swissspidy Thank you! I didn't find that ticket 🚀

Note: See TracTickets for help on using tickets.