WordPress.org

Ready to get started?Download WordPress

Forums

YD Network-wide Options
[PATCH] Deprecated use of add_options_page (1 post)

  1. flynsarmy
    Member
    Posted 1 year ago #

    In yd-wpmu-sitewide-options.php method yd_wpmuso_menu() you're calling:

    add_options_page(
    	__('YD Network-wide Options',
    		'yd-wpmuso'),
    	__('YD Network-wide Options', 'yd-wpmuso'),
    	8,
    	__FILE__,
    		'yd_wpmuso_options'
    		);

    When WP_DEBUG is on this results in the PHP warning:
    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 /path/to/wp-includes/functions.php on line 2722

    As per the documentation the third argument should be a capability - in your case probably manage_options?

    Replace your above code with the following and you should be good to go:

    function yd_wpmuso_menu() {
    	add_options_page(
    		__('YD Network-wide Options', 'yd-wpmuso'),
    		__('YD Network-wide Options', 'yd-wpmuso'),
    		'manage_options',
    		__FILE__,
    		'yd_wpmuso_options'
    	);
    }

    http://wordpress.org/extend/plugins/yd-wpmu-sitewide-options/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.