Deprecated: has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead code example

Example: has_cap was called with an argument that is deprecated since version 2.0!

//Wrong, using '8' as a role identifier
 
add_menu_page( 'UtMan', 'UtMan', 8, 'utman', array(&$this, 'mainAdmin'), null, 6);
 
//Changed to a capability, correct
 
add_menu_page( 'UtMan', 'UtMan', 'edit_pages', 'utman', array(&$this, 'mainAdmin'), null, 6);
 
//Wrong, using 'administrator' as a role identifier
 
add_submenu_page('utman', 'UtMan Requests', 'Requests', 'administrator', 'utman-requests', array(&$this, 'requestPage'));
 
//Changed to a capability, correct
 
add_submenu_page('utman', 'UtMan Requests', 'Requests', 'edit_pages', 'utman-requests', array(&$this, 'requestPage'));

Tags:

Misc Example