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

ajax - Gutenberg block - Save PHP function's output as HTML?

programmeradmin3浏览0评论

I am new to creating blocks in the editor but have practiced with a couple tuts. I have been able to create a block that is able to use ServerSideRender, but after reading am I correct to think it is rendered on the frontend?

I am wondering if there is a way to create a block, call a php function, return a html output, and save the block as html output. So it does not have to render the php function each time the block is called.

Am I suppose to use REST or can you use Ajax some how?

The reason is because there is a custom table in the database that I would like to get information from and put it into the block, but I would rather not call the table multiple times in the frontend.

Thanks

发布评论

评论列表(0)

  1. 暂无评论