• baldarch

    (@baldarch)


    Hi

    I have just commenced using Debug Bar and am seeing an error on sites with current WordPress 4.2.2:

    wp-admin/menu-header.php:155 – Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.
    require_once(‘wp-admin/admin-header.php’), require(‘wp-admin/menu-header.php’), _wp_menu_output, current_user_can

    Is this a true error? Or just that the method is deprecated? It’s in the Codex:
    https://codex.ww.wp.xz.cn/Function_Reference/current_user_can

    Do I need to take any action?

    Your advice would be appreciated.

    https://ww.wp.xz.cn/plugins/debug-bar/

Viewing 1 replies (of 1 total)
  • The current_user_can() function itself is not deprecated.

    The notice you’re receiving is because there’s a plugin/theme somewhere in your system that, instead of checking user capabilities with something like current_user_can( 'manage_options' ) is using the numerical user levels, like current_user_can( 7 ).

    The numerical user levels were deprecated a long time ago, but some plugins/themes still use them.

    http://codex.ww.wp.xz.cn/Roles_and_Capabilities#User_Levels

Viewing 1 replies (of 1 total)

The topic ‘User level code deprecated – is this an error?’ is closed to new replies.