WordPress.org

Ready to get started?Download WordPress

Forums

Audio Player
Notice: has_cap called with an argument that is deprecated (13 posts)

  1. wpsecuritylock
    Member
    Posted 3 years ago #

    Just installed on a fresh WordPress blog using 3.1.3.

    Testing in debug mode, upon activation I received the following error:

    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 /home/test/public_html/wp-includes/functions.php on line 3387

    Any ideas how to fix this?

  2. andrew_bap
    Member
    Posted 3 years ago #

    I have the same issue.... please, help us...!!!

  3. Daniele Raimondi
    Member
    Posted 3 years ago #

    Do you have some plugin active? I was having the same problem with one of my oldest plugin, calling "add_submenu_page" with a numeric user level instead of a capability name.

  4. wpsecuritylock
    Member
    Posted 3 years ago #

    No, I did not have any other plugin active.

  5. gjcounter
    Member
    Posted 3 years ago #

    I have exactly the same problem. Same error, file and line, and no plugin activated.

  6. MC1960
    Member
    Posted 3 years ago #

    Yes the same here, what is this and how can i take this away is getting worse if I have installed. I need those plug in.

    "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 /var/www/web/wse336729/wp-includes/functions.php on line 3466"

  7. Mikkel Breum
    Member
    Posted 2 years ago #

    Same here, running WP v.3.2.1 and Audio-Player v.2.0.4.1

    I get:

    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 /Users/mikkel/Dropbox/Safe/annikalundgren/wp-includes/functions.php on line 3466

  8. nadiacosta
    Member
    Posted 2 years ago #

    Uh oh I'm having the same problem here :(

  9. Daniele Raimondi
    Member
    Posted 2 years ago #

    the solution is to disable plugin one by one, until you find the one causing the warning. Then, find a call like "add_submenu_page" or similar, using a numeric user level instead of a capability name.
    Substitute the numeric user level with a compatible capability or user role and the warning should vanish.

  10. comunite
    Member
    Posted 2 years ago #

    I am having this problem and I am not sure how it started and how to fix it - any advice?

    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 /home/department/wordpress/wp-includes/functions.php on line 3466

  11. cg433n
    Member
    Posted 2 years ago #

    To fix this problem, go to line 176 of audio-player.php (/wp-content/plugins/audio-player/audio-player.php).
    The line looks like this:
    $pageName = add_options_page("Audio player options", "Audio Player", 8, $this->optionsPageName, array(&$this, "outputOptionsSubpanel"));

    Change the 8 (a numeric user level) to 'activate_plugins' (single quotes included), so that the line looks like this:
    $pageName = add_options_page("Audio player options", "Audio Player", 'activate_plugins', $this->optionsPageName, array(&$this, "outputOptionsSubpanel"));

  12. istvannonn
    Member
    Posted 2 years ago #

    Thanks, cg433n
    it works for me for a different plugin.

  13. brasofilo
    Member
    Posted 2 years ago #

    @cg433n,
    same problem with my own plugin... solved now, thanks !

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic