Make WordPress Core

Opened 15 months ago

Closed 15 months ago

Last modified 14 months 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 (4)

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


15 months 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
15 months 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.

@swissspidy commented on PR #5217:


14 months ago
#4

This change needs to happen in Gutenberg. See https://github.com/WordPress/gutenberg/pull/55400

Note: See TracTickets for help on using tickets.