WordPress的ADD_ADMIN_PAGE即使参数正确也无法工作?

时间:2017-04-04 作者:Y07

function Y_add_admin_page(){
add_menu_page(\'Y-07 Theme Options\',\'Y-07\',\'mange_options\',\'y-admin\',\'Y_admin_create\',\'\',110); 

    }
 add_action(\'admin_menu\',\'Y_add_admin_page\');
我使用了is\\u admin函数,即使我是管理员,它也返回false

1 个回复
最合适的回答,由SO网友:kamleshpal 整理而成

Please try this

add_action(\'admin_menu\',\'Y_add_admin_page\');

function Y_add_admin_page(){

    add_menu_page(
          \'Y-07 Theme Options\'
        , \'Y-07\'
        , \'manage_options\'
        , \'y-admin\'
        , \'Y_admin_create\'
        , \'\'
        , 110
    );

}

相关推荐