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

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -