1
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');

I had used is_admin function it is returning false even I am an adminstrator

  • is_admin() function doesn't check if you are admin, it checks if the page you are visiting is a wp-admin page. – Fayaz Apr 4 '17 at 11:21
  • please edit your question to explain what is "not working" – mmm Apr 4 '17 at 11:31
2

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
    );

}
  • @ kamlesh pal Not Working – Y07 Apr 4 '17 at 11:12
  • 1
    i have tried this in my local setup of WordPress and now i can see the menu in left side of my wordpress cms – kamleshpal Apr 4 '17 at 11:15
  • 1
    And also you have to create Y_admin_create this function to show what you want after click – kamleshpal Apr 4 '17 at 11:16
  • Created call back function but no use – Y07 Apr 4 '17 at 11:24
  • I had checked i am logged in and shows i am adminstrator but when i test in php file is_admin returns false – Y07 Apr 4 '17 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.