admin管理员组

文章数量:1323035

I am using has_block() to check if post has a specific block type but it does not see blocks inside another blocks, like columns block. So, how to make it find a gallery inside the column?

I am using has_block() to check if post has a specific block type but it does not see blocks inside another blocks, like columns block. So, how to make it find a gallery inside the column?

Share Improve this question asked Sep 20, 2020 at 13:52 MarkJMarkJ 631 gold badge2 silver badges5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

It should, because has_block( 'gallery' ) uses source strpos() to determine if the post content has the <!-- wp:gallery string.

本文标签: functionshow to make hasblock() see inside blocks too