WordPress.org

Support

Support » Plugins and Hacks » [Resolved] has_cap was called with an argument that is deprecated since version 2.0

[Resolved] has_cap was called with an argument that is deprecated since version 2.0

  • travelvice
    Member

    @travelvice

    This plugin is throwing the following error in the admin menu:

    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.

    The offending function is:

    function tse_add_options_submenu() {
    	$tse_options_page = add_submenu_page( 'options-general.php', 'Tango Smileys Extended: Options', 'Tango Smileys Extended', 10, 'tango-smileys-extended', 'tse_options' );
    	add_action( "admin_print_scripts-$tse_options_page", 'tse_options_script' );
    	add_action( "admin_print_styles-$tse_options_page", 'tse_options_style' );
    }

    Passing 10 as a permissions level is no more. This value should be a string. Since I’m the only user I’ve replaced 10 with ‘read’ and the error clears up nicely.

    $tse_options_page = add_submenu_page( 'options-general.php', 'Tango Smileys Extended: Options', 'Tango Smileys Extended', 'read', 'tango-smileys-extended', 'tse_options' );

    http://wordpress.org/extend/plugins/tango-smileys-extended/

Viewing 1 replies (of 1 total)
  • Plugin Author whesleymccabe
    Member

    @whesleymccabe

    This has been fixed. I haven’t noticed any error, but you are correct about the depreciation.

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] has_cap was called with an argument that is deprecated since version 2.0’ is closed to new replies.