Load wordpress shortcode with a button?

狂风中的少年 提交于 2019-12-11 16:16:59

问题


Question:

Is it possible to load a WordPress shortcode on demand, e.g. with a button?

Explanation:

I have a gallery plugin, it has a shortcode. Unfortunately, the plugin does NOT use image defer mechanism on page load. So it has too many image requests that hurt speed ranking.

Is this idea possible:

I want a "load gallery" button. When it's pressed, the gallery shortcode is loaded. Any recommendation / article / key concepts is welcomed. I don't even know where to start.


回答1:


You can add custom buttons to the editor -> https://codex.wordpress.org/TinyMCE_Custom_Buttons



来源:https://stackoverflow.com/questions/49453524/load-wordpress-shortcode-with-a-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!