• Hi All

    I’m having problems with a menu page. I have setup

    add_action('admin_menu', 'todays_orders_page'); 
    
    function todays_orders_page() {
    	add_menu_page('Todays orders', 'Todays orders', 'todays_orders', __FILE__,'todays_orders');
    }

    However, visiting the page with a user who has “todays_orders” capability results in a permission denied error.

    Any help would be great.

    Thanks
    Mark

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Does your menu page by any chance use the Settings API to display and save values? If so, you need to alter the capabilities allowed for the API in addition to the one for accessing the menu page. See the second note here.

    If you’re not using the Settings API, then I’ve no idea about your problem, sorry. You may need to trace through the menu code after the do_action('admin_menu') point to determine what condition is triggering the error.

Viewing 1 replies (of 1 total)

The topic ‘admin_menu and capability’ is closed to new replies.