customization - Gutenberg Blocks - Attributes from comment delimiter or from HTML?

I wrote a custom block and am trying to better understand the interplay of the JavaScript and PHP on both front and back

I wrote a custom block and am trying to better understand the interplay of the JavaScript and PHP on both front and back end regarding blocks.

Say I have some block that I want rendered dynamically. That leads to questions:

  1. For dynamic blocks I take it we have to guarantee that the attributes are in the JSON in the comments delimiter?
  2. On front end, is there any reason to have the block comments displayed? Should we always use a filter when displaying posts to remove the block comments, or are these attributes someone used by client side javascript?
  3. Endpoints: Here is where I am really confused. For dynamic block rendering we are supposed to specify a PHP callback. Is that to be called by a restAPI endpoint (in which case do we have to set show_in_rest to true for dynamic blocks?) or is there a separate mechanism?

Just looking for some clarification on these points.

thanks

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744929075a4601621.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信