Answers for "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"

PHP
0

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'));
Posted by: Guest on June-29-2020

Code answers related to "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"

Browse Popular Code Answers by Language