admin管理员组文章数量:1125076
I was wondering if there is any way to: replace a Gutenberg block (in this case the navigation), with ESI, + fetch this block in another endpoint the ESI tag points to. In classic themes this is fairly easy because you can get nav + id.
Haven't found something like this with blocks (render_block contains a reference like core/navigation
but it isn't unique).
I was wondering if there is any way to: replace a Gutenberg block (in this case the navigation), with ESI, + fetch this block in another endpoint the ESI tag points to. In classic themes this is fairly easy because you can get nav + id.
Haven't found something like this with blocks (render_block contains a reference like core/navigation
but it isn't unique).
- What is ESI? Edge side includes? – Lovor Commented Feb 10, 2024 at 10:40
1 Answer
Reset to default 0I am not sure If I get what you meant, but study https://developer.wordpress.org/reference/hooks/render_block_this-name/
filter, whan calling it give it $accepted_args number of 3 and inspect what is returned in $block_content or $instance. ID is encoded as ref attribute, if that's what you are missing.
You could also use render_block
filter, but render_block_{$this->name}
is more convenient, since it is called just for block type specified in filter name.
本文标签: hooksReplacing specific Gutenberg blocks
版权声明:本文标题:hooks - Replacing specific Gutenberg blocks 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736656100a1946258.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论