我创建了一个使用ajax的插件问题是插件请求加载在整个站点上,而不仅仅加载在插件页面上,我只需要在插件页面上调用该函数
插件主代码
// If this file is called directly, abort.
if ( ! defined( \'WPINC\' ) ) {
die;
}
define("Importer",plugin_basename(__FILE__));
define("PLUGIN_DIR",__DIR__);
require_once PLUGIN_DIR."/vendor/autoload.php";
if(is_admin()){
$moviewp = new \\App\\Bootstrap();
}
每次使用ajax在站点上执行操作时出现调试错误
call_user_func_array() expects parameter 1 to be a valid callback, class \'App\\Bootstrap\' does not have a method \'process_moviewp_like\' in C:\\xampp\\htdocs\\clean\\wp-includes\\class-wp-hook.php on line 287
如何排除站点ajax请求并将其与插件分离?