[wp-trac] [WordPress Trac] #53140: State clearly that has_block() doesn't work in reusable blocks

WordPress Trac noreply at wordpress.org
Sat May 29 18:41:22 UTC 2021


#53140: State clearly that has_block() doesn't work in reusable blocks
------------------------------+-----------------------------
 Reporter:  vyskoczilova      |       Owner:  SergeyBiryukov
     Type:  enhancement       |      Status:  closed
 Priority:  normal            |   Milestone:  5.8
Component:  Editor            |     Version:
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:  docs
------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"51046" 51046]:
 {{{
 #!CommitTicketReference repository="" revision="51046"
 Docs: Document that `has_block()` does not check reusable blocks.

 Since the function only checks the raw, non-parsed post content, reusable
 blocks are just a `core/block` type and nothing more at that point.

 In order to also check reusable blocks, the content needs to be parsed
 using `parse_blocks()` first.

 Props vyskoczilova, peterwilsoncc.
 Fixes #53140.
 }}}

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


More information about the wp-trac mailing list