[wp-trac] [WordPress Trac] #46133: Parse blocks to generate the excerpt

WordPress Trac noreply at wordpress.org
Tue Jan 29 13:01:22 UTC 2019


#46133: Parse blocks to generate the excerpt
--------------------------+-----------------------------
 Reporter:  gziolo        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Moved from GitHub: https://github.com/WordPress/gutenberg/pull/11704

 Originally authored by @pento:

 Now that https://github.com/WordPress/gutenberg/pull/11141 has landed, we
 can use the same logic when generating an excerpt, which allows us to
 `deprecate get_dynamic_blocks_regex()`.

 By using a list of allowed blocks, we can avoid the other issue that
 `strip_dynamic_blocks()` is intended to address, when a dynamic block can
 call `get_the_excerpt()`, causing an infinite loop.

 Out of interest,
 https://github.com/WordPress/gutenberg/commit/198c82f0323a433eaea33f63a3fb94866be5ba32
 is an alternate method, which just tweaks `strip_dynamic_blocks()` to use
 the parser, but I think this is the better method.

 It should be recreated in core based on the referenced Pull Request.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46133>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list