Wordpress admin_menu capability -
i'm having problems menu page. 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 page user has "todays_orders" capability results in permission denied error.
any great.
thanks mark
the arguments passing add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position ) not correct - omitting "capability" , not passing in page function. try following (this example uses edit_posts capability). should replace "page_function" function used display page contents.
add_menu_page( "today's orders", "today's orders", 'todays_orders', 'edit_posts', 'page_function' );      
Comments
Post a Comment