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?
1 Answer
Reset to default 1It should, because has_block( 'gallery' )
uses source strpos()
to determine if the post content has the <!-- wp:gallery
string.