我正在创建自定义插件,当我检查我的页面时,可以看到警告消息Deprecated: Non-static method woo_filter_master_controller::index() should not be called statically
,任何人都可以帮助我为什么收到此警告吗?在这里,我添加了我的插件控制器代码。
<?php
class woo_filter_master_controller {
public function index() {
ob_start();
global $wpdb;
include(dirname(__FILE__) . "/html/list_master_details.php");
$s = ob_get_contents();
ob_end_clean();
print $s;
}
public function get_data() {
global $wpdb, $wp;
}
function add_menu_pages() {
add_menu_page('Woo-Filtr', 'Woo-Filter', 'manage_options', 'woo-filter', Array("woo_filter_master_controller", "index"));
}
}
$obj_woo_filter_master = new woo_filter_master_controller();
add_action('admin_menu',array($obj_woo_filter_master, 'add_menu_pages'));
add_action('wp_ajax_woo_filter_master_controller::get_data', Array($obj_woo_filter_master, 'get_data'));
add_action('wp_ajax_nopriv_woo_filter_master_controller::get_data', array($obj_woo_filter_master, 'get_data'));
?>