Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.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 我的插件有模板目录,它们都没有执行任何wp函数。所有正在抛出致命错误:调用未定义函数_Php_Wordpress - Fatal编程技术网

Php 我的插件有模板目录,它们都没有执行任何wp函数。所有正在抛出致命错误:调用未定义函数

Php 我的插件有模板目录,它们都没有执行任何wp函数。所有正在抛出致命错误:调用未定义函数,php,wordpress,Php,Wordpress,我是wordpress的新手,正在创建一个插件,在我的插件模板文件夹中自动创建了一个错误日志,其中列出了很多错误- [22-Dec-2015 07:57:25 Etc/GMT]PHP致命错误:调用未定义 函数wp_redirect()位于 /home/techgwpj/public_html/www.hostrecyclers.com/WP/doctor/WP-content/plugins/tg-doctorin/templates/user-activation.php 第12行 当我在我的

我是wordpress的新手,正在创建一个插件,在我的插件模板文件夹中自动创建了一个错误日志,其中列出了很多错误-

[22-Dec-2015 07:57:25 Etc/GMT]PHP致命错误:调用未定义 函数wp_redirect()位于 /home/techgwpj/public_html/www.hostrecyclers.com/WP/doctor/WP-content/plugins/tg-doctorin/templates/user-activation.php 第12行

当我在我的
主题/模板
文件夹中做同样的事情时,它工作得很好,但当我将相同的代码放入我的插件/模板文件夹时,它就停止了工作,出现了一个空白页,所有的wp函数都没有定义
i、 e.
wp\u重定向,get\u header(),get\u footer()
etc

您如何调用此模板?get\u header();在plugins/tg doctorin/templates/user-activation.php文件中…但它抛出了致命错误:调用未定义的函数get_header()实际上,此文件夹文件中的每个wp函数都未定义。不,我的意思是如何调用整个user-activation.php文件?添加_过滤器('page_template','catch_mypath');函数catch_mypath($page_template){if(is_page('user')){$page_template=DOC_URL./templates/my_profile.php'}if(is_page('user-activation')){$page_template=DOC_URL./templates/user activation.php'}if(is_page('user-edit')){$page_template=DOC_URL./templates/edit profile.php'}返回$page_template;}