[wp-trac] [WordPress Trac] #59043: the_excerpt() function return excerpt with different length in page load and ajax request on WordPress 6.3

WordPress Trac noreply at wordpress.org
Wed Aug 23 22:10:11 UTC 2023


#59043: the_excerpt() function return excerpt with different length in page load
and ajax request on WordPress 6.3
-------------------------------------+---------------------
 Reporter:  sarathlal                |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  high                     |   Milestone:  6.3.2
Component:  Editor                   |     Version:  6.3
 Severity:  major                    |  Resolution:
 Keywords:  needs-testing has-patch  |     Focuses:
-------------------------------------+---------------------

Comment (by SergeyBiryukov):

 If anyone is looking for a workaround, this should restore the excerpt
 length to whatever it was set before it is altered in [source:tags/6.3/src
 /wp-includes/blocks/post-excerpt.php#L80 blocks/post-excerpt.php]:
 {{{
 function wp59043_restore_excerpt_length() {
         global $wp_filter;

         unset( $wp_filter['excerpt_length']->callbacks[ PHP_INT_MAX ] );
 }
 add_action( 'init', 'wp59043_restore_excerpt_length' );
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59043#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list