php - How i can call my plugin use shortcode Wordpress?
问题描述
I have a plugin file. It has html and php code. I would like to call it with shortcode.
解决方案
Hi You can do all stuff into
function myshort( $atts ) {
//add your html php code here
add_shortcode( 'my_short', 'myshort' );
then use shortocde [my_short] in your pages
推荐阅读
- android - 我面临身份验证问题:com.pusher.client.AuthorizationFailureException: java.io.FileNotFoundException 问题在 Android
- python-3.x - 在 python 中应用预训练的 facebook/bart-large-cnn 进行文本摘要
- javascript - 字符串未正确出现在 URL 中以处理带有 %20 的空格
- javascript - 在进行多次测试之前使用它是一个好主意吗?
- python - Numpy 数组:如何将 2D 数组的值转换为 3D one-hot 数组
- c++ - wxCharts:无法打开源文件
- asp.net-core - 如何从 c#
- office-ui-fabric-react - 将类和 id 添加到 React Fabric UI 透视项 headerButtonProps
- math - 如何在 gnuplot 中绘制此图像的表面
- antlr - 语法错误地抓住了错误的规则,尽管在该规则中没有'并且在我的文本中我有'