[wp-hackers] add_menu_page et al. use deprecated user levels
ringmaster at midnightcircus.com
Mon Mar 6 21:10:36 GMT 2006
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.
More information about the wp-hackers