我试图在WordPress上添加一个管理子级菜单。菜单链接工作正常,但我要显示的页面出现错误。
错误:
警告:call\\u user\\u func\\u array()要求参数1为有效回调,在/var/www/html/woocommerce print/wp includes/class wp hook中找不到函数“print\\u admin\\u config”,或函数名无效。php在线286
挂钩:
add_action( \'admin_menu\', \'print_admin_menu\' );
function print_admin_menu() {
add_options_page( \'Print Configuration\', \'Print Configuration\', \'manage_options\',
\'woocommerce-print/admin/print-admin-config.php\', \'print_admin_config\', \'dashicons-tickadmin-generic\', 31 );
}
回调函数(woocommerce print/admin/print admin config.php):
<?php
function print_admin_config(){
?>
<div class="wrap">
<h2>Welcome To My Plugin</h2>
</div>
<?php
}