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

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

1 Answer 1

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

}
5
  • @ kamlesh pal Not Working
    – Y07
    Commented Apr 4, 2017 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
    Commented Apr 4, 2017 at 11:15
  • 1
    And also you have to create Y_admin_create this function to show what you want after click
    – kamleshpal
    Commented Apr 4, 2017 at 11:16
  • Created call back function but no use
    – Y07
    Commented Apr 4, 2017 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
    Commented Apr 4, 2017 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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