admin管理员组文章数量:1122832
I’ve got a shortcode plugin which allows me to output a block of HTML in one of a few different formats based on parameters.
[mm-postlinking]
[mm-postlinking id="281493" template="thumbnail"]
[mm-postlinking template="link" link_text="View page"]
etc.
Currently all of the formats are visual, but I’m wondering if I can return a data object or associative array from the plugin instead of markup. Basically I have an area of my site that could use the data being generated by this plugin, but has it’s own layout. So it would be great if I could call the plugin (or code within the plugin), directly and get just the data back.
If it matters, the plugin code is class based. I'm on WordPress 6.4.4 and I'm explicitly not using Gutenberg (if that matters).
本文标签: plugin developmentShortcode to return data instead of outputting HTML
版权声明:本文标题:plugin development - Shortcode to return data instead of outputting HTML? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736302793a1931659.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论