函数的最后一个参数add_submenu_page
显示页面内容时要调用的函数的名称。如下所述:
http://codex.wordpress.org/Function_Reference/add_submenu_page
正确的用途是:
add_submenu_page( \'antify\', \'Plugins\', \'Plugins\', \'manage_options\', \'plugins\', \'my_function\' );
function my_function(){
echo \'hello\';
}
如果需要单独的文件,可以这样做
add_submenu_page( \'antify\', \'Plugins\', \'Plugins\', \'manage_options\', \'plugins\', \'my_function\' );
function my_function(){
include plugin_dir_path( __FILE__ ) . \'path/of/file.php\';
}