最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - how to make has_block() see inside blocks too

programmeradmin7浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论