[wp-trac] [WordPress Trac] #43826: get_post_galleries() should return gallery blocks

WordPress Trac noreply at wordpress.org
Mon Nov 5 22:05:09 UTC 2018


#43826: get_post_galleries() should return gallery blocks
------------------------------------------+---------------------
 Reporter:  pento                         |       Owner:  (none)
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  5.0
Component:  Media                         |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+---------------------

Comment (by tellyworth):

 attachment:43826.2.diff uses `parse_blocks()` to crudely parse gallery
 blocks and include the corresponding images in `get_post_galleries()` and
 related functions. Unit tests are included.

 Currently it still relies on regexes to grab the `<img src="..">` values
 from the gallery block's innerHtml. That could be improved when GB11212
 lands, as @pento suggests.

 Please note that I have ''only'' tested this with phpunit tests. I
 probably missed and/or broke something as well.

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


More information about the wp-trac mailing list