Support » Plugins and Hacks » [Plugin: User Photo] Deprecated 'has_cap' function warning

[Plugin: User Photo] Deprecated 'has_cap' function warning

  • This is quite a neat plugin for uploading a user pic. But there are a couple of warnings that may disturb something in your site! One of these warnings is:

    Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in /xyz/wp-includes/functions.php on line 2712

    The solution is to use current_user_can() instead. For example:
    The line:
    $current_user->has_cap('edit_users') is deprecated
    Instead use:

    You can directly change the plugin file, but it is not recommended as a plugin update might overwrite your changes (if the authors don’t implement this!)

    AUTHORS, please change this! 😉

    Hope this helps!

    – Rutwick


  • The topic ‘[Plugin: User Photo] Deprecated 'has_cap' function warning’ is closed to new replies.