Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在自定义短代码中调用未定义的函数do_短代码_Php_Wordpress_Shortcode - Fatal编程技术网

Php 在自定义短代码中调用未定义的函数do_短代码

Php 在自定义短代码中调用未定义的函数do_短代码,php,wordpress,shortcode,Php,Wordpress,Shortcode,我正在为WPBakery插件创建一个自定义元素,并在添加do\u shortcode($content)时收到一个错误 我的元素名为hero.php,其功能如下(在WPBakery中): 用户从选项(hero\u html())中选择hero模块 然后,用户可以(在hero模块中)选择添加幻灯片(hero\u content\u html()) 视觉: var\u dump($content)吐出正确的字段和值,但不确定为什么do\u shortcode未定义 下面是调用函数的地方: 请

我正在为WPBakery插件创建一个自定义元素,并在添加
do\u shortcode($content)
时收到一个错误

我的元素名为
hero.php
,其功能如下(在WPBakery中):

  • 用户从选项(
    hero\u html()
    )中选择hero模块
  • 然后,用户可以(在hero模块中)选择添加幻灯片(
    hero\u content\u html()
视觉:

var\u dump($content)
吐出正确的字段和值,但不确定为什么
do\u shortcode
未定义

下面是调用函数的地方:


请检查wp-load.php文件是否在此页面之前加载。
要运行do_shortcode(),需要wp-load.php