Make WordPress Core

Opened 2 weeks ago

Closed 2 weeks ago

#59350 closed defect (bug) (duplicate)

Excerpt Length Hook Has No Effect in Admin Ajax Request

Reported by: dcooney's profile dcooney Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.3
Component: Editor Keywords: has-patch
Focuses: administration, template Cc:

Description

When performing an Ajax request via admin-ajax.php custom excerpt_length hooks in themes and plugins are being overwritten by the hook in wp-includes/blocks/post-excerpt.php.

https://github.com/WordPress/WordPress/blob/master/wp-includes/blocks/post-excerpt.php#L86-L95

This line is forcing 100 words to be returned in all admin-ajax requests.

Change History (3)

This ticket was mentioned in PR #5217 on WordPress/wordpress-develop by @dcooney.


2 weeks ago
#1

  • Keywords has-patch added

This PR adds an additional check for wp_doing_ajax() to allow custom excerpt_length hooks in theme and plugins to run on the frontend via admin-ajax.

Trac Ticket: 59350

#3 @SergeyBiryukov
2 weeks ago

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

Hi there, welcome to WordPress Trac!

Thanks for the report, we're already tracking this issue in #59043.

Note: See TracTickets for help on using tickets.