Javascript 在wordpress中调用未定义的函数get_field_id()

Javascript 在wordpress中调用未定义的函数get_field_id(),javascript,php,jquery,ajax,wordpress,Javascript,Php,Jquery,Ajax,Wordpress,致命错误:在第6行的E:\wamp\www\customfield\wp content\plugins\custom-widget2\update.php中调用未定义的函数get\u field\u id 我正在使用ajax创建第二个下拉列表。我的ajax页面名为update.php,但作为响应,我调用了未定义的函数get\u field\u id。 我正在为widgit制作一个插件 update.php 请帮助我……该功能超出范围 修复添加 require('/the/path/to/yo

致命错误:在第6行的E:\wamp\www\customfield\wp content\plugins\custom-widget2\update.php中调用未定义的函数get\u field\u id

我正在使用ajax创建第二个下拉列表。我的ajax页面名为update.php,但作为响应,我调用了未定义的函数get\u field\u id。 我正在为widgit制作一个插件

update.php


请帮助我……

该功能超出范围

修复添加

require('/the/path/to/your/wp-blog-header.php');

在文件的顶部

必须包含wp-blog-header.php文件,该文件位于wp安装的根文件夹中。Sajid Anwar如果有问题,请在答案下方发表评论,不要对问题进行编辑。从您被拒绝的编辑中,您是否使用了正确的路径tp wp blog header?$this->get_field_id'test2'仍不能工作。我在页面顶部包含include_once$_SERVER['DOCUMENT_ROOT']./customfield/wp blog header.php';
require('/the/path/to/your/wp-blog-header.php');