WordPress.org

Ready to get started?Download WordPress

Forums

WP Render Blogroll Links
[resolved] has_cap error when wp-debug=true (2 posts)

  1. Gyroscopic
    Member
    Posted 1 year ago #

    Hi great plugin - works a treat!

    However, when using wp-debug = true I get 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 C:\wampserver\www\mysite\wp-includes\functions.php on line 2923
    Call Stack
    #    Time    Memory    Function    Location
    1    0.0004    702544    {main}( )    ..\media-upload.php:0
    2    0.0009    819952    require_once( 'C:\wampserver\www\mysite\wp-admin\admin.php' )    ..\media-upload.php:16
    3    0.3880    39733688    require( 'C:\wampserver\www\mysite\wp-admin\menu.php' )    ..\admin.php:106
    4    0.3943    39905816    require_once( 'C:\wampserver\www\mysite\wp-admin\includes\menu.php' )    ..\menu.php:244
    5    0.4064    39911288    do_action( $tag = 'admin_menu', $arg = '' )    ..\menu.php:97
    6    0.4067    39913984    call_user_func_array ( 'renderlinks_admin', array (0 => '') )    ..\plugin.php:406
    7    0.4067    39914016    renderlinks_admin( '' )    ..\plugin.php:406
    8    0.4067    39914432    add_options_page( $page_title = 'WP Render Blogroll Links', $menu_title = 'WP Blogroll Links', $capability = 8, $menu_slug = 'WP-Render-Blogroll.php', $function = 'renderlinks_settings_page' )    ..\WP-Render-Blogroll.php:469
    9    0.4067    39914520    add_submenu_page( $parent_slug = 'options-general.php', $page_title = 'WP Render Blogroll Links', $menu_title = 'WP Blogroll Links', $capability = 8, $menu_slug = 'WP-Render-Blogroll.php', $function = 'renderlinks_settings_page' )    ..\plugin.php:1084
    10    0.4067    39914992    current_user_can( $capability = 8 )    ..\plugin.php:1012
    11    0.4068    39915824    call_user_func_array ( array (0 => class WP_User { public $data = class stdClass { ... }; public $ID = 1; public $caps = array (...); public $cap_key = 'wp_capabilities'; public $roles = array (...); public $allcaps = array (...); public $filter = NULL }, 1 => 'has_cap'), array (0 => 8) )    ..\capabilities.php:1289
    12    0.4068    39916144    WP_User->has_cap( $cap = 8 )    ..\capabilities.php:1289
    13    0.4068    39916464    _deprecated_argument( $function = 'has_cap', $version = '2.0', $message = 'Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.' )    ..\capabilities.php:920
    14    0.4069    39916968    trigger_error ( 'has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.' )    ..\functions.php:2923

    If I deactivate the plugin the error stops.

    Do you have any ideas? Looks like $cap=8 maybe a problem?

    http://wordpress.org/extend/plugins/wp-render-blogroll-links/

  2. Gyroscopic
    Member
    Posted 1 year ago #

    Doh! the answer was a few posts earlier - shame the plugin author cant update the plugin with the fixes!

    Anyway, to spell it out, change the 8 in line 469 in WP-Render-Blogroll.php from

    function renderlinks_admin() {
    	if (function_exists('add_options_page')) {
    		add_options_page('WP Render Blogroll Links', 'WP Blogroll Links', 8, basename(__FILE__), 'renderlinks_settings_page');
    	}
    }

    to

    function renderlinks_admin() {
    	if (function_exists('add_options_page')) {
    		add_options_page('WP Render Blogroll Links', 'WP Blogroll Links', 'manage_options', basename(__FILE__), 'renderlinks_settings_page');
    	}
    }

    capabilities use strings such as 'manage_options' not numbers any more.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags