Unless I'm missing something, it seems even in the latest nightly one
is forced to use the old user-level syntax when adding menus to the
admin control panel and using functions like add_menu_page,
Wouldn't it be better if we could pass a role or capability--instead
of just an access_level--as an argument to functions like
add_menu_page? That way all and only those that have, say,
"forum_moderator" capability could access their own menus,
independently of their overall WP roles.
wp-hackers mailing list
[hidden email] http://lists.automattic.com/mailman/listinfo/wp-hackers
Re: add_menu_page et al. use deprecated user levels
Austin Matzko wrote:
> Unless I'm missing something, it seems even in the latest nightly one
> is forced to use the old user-level syntax when adding menus to the
> admin control panel and using functions like add_menu_page,
> add_options_page, etc.
You can pass a capability in that parameter. The Codex docs on the
function are out of date.
WordPress handles numeric values passed for that parameter like it
handles all numeric $user->has_cap(X) calls, by verifying that the user
has a "level_X" capability. That's why it still works.