• I’m likely posting into a void since this plugin hasn’t been updated in some time. However, I’d like to resolve a depreciated tag if possible.

    I’m debugging my website and the following warning pops up.

    F:\inetpub\wwwroot\wp-includes\class-wp-user.php:716 – has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    require_once(‘F:\inetpub\wwwroot\wp-admin\admin-header.php’), require(‘F:\inetpub\wwwroot\wp-admin\menu-header.php’), _deprecated_argumentwp_menu_output, current_user_can, WP_User->has_cap, _deprecated_argument

    Any advice is appreciated even if months go by.

    https://developer.www.ads-software.com/reference/classes/wp_user/has_cap/

    Thanks,
    Joe

Viewing 1 replies (of 1 total)
  • Hey Joe – I fixed this a few months back for an instance I run for a college library website. The issue is where the menu page and options page are added. In the current code, it uses a numeric capability (which is deprecated). I replaced it with a named capability (‘manage_options’), and was able to fix the issue.

    You can find the menu page code around line #432, and the options code around line #443 of cas-maestro.php

    Old:

    $settings_page = add_options_page(__('CAS Maestro', "CAS_Maestro"), 
    						__('CAS Maestro', "CAS_Maestro"), 8, 
    						'wpcas_settings', 
    						array(&$this,'admin_interface'));

    Updated:

    $settings_page = add_options_page(
    					    __('CAS Maestro', "CAS_Maestro"),
                            __('CAS Maestro', "CAS_Maestro"),
                            'manage_options',
    						'wpcas_settings', 
    						array(&$this,'admin_interface')
                        );

    Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘has_cap deprecated since version 2.0.0’ is closed to new replies.