has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead. in /Site/policy soapbox-wp/htdocs/wp-includes/functions.php on line 5143 code example

Example: has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead. in C:\xampp 2\htdocs\dashboard\wordpress single\wp-includes\functions.php on line 4997

//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:

Php Example