WordPress.org

Ready to get started?Download WordPress

Forums

Deprecated problem, can't figure it out (3 posts)

  1. vk011
    Member
    Posted 9 months ago #

    Hello,

    I am doing a plugin tutorial but it was made for wordpress 2. something.

    The problem is - when I go to admin menu, under Settings - I get a notice error =>

    " 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:\wamp\www\jw\wp-includes\functions.php on line 3017"

    This is the relevant code:

    <?php
    
    if ( ! class_exists('SBC_Admin') ) {
    
    	class SBC_Admin {
    
    		function add_config_page() {
    
    			if ( function_exists('add_submenu_page') ) {
    				add_options_page(
    					'Seach by Category Options',
    					'Search by Category',
    					10,
    					basename(__FILE__),
    					array('SBC_Admin', 'config_page')
    				);
    			}
    		}
    
    		function config_page() {
    			if ( isset($_POST['submit']) ) { // we're updating options
    
    			}?>
    			<div class="wrap">
    				<h2>Search by category options</h2>
    				<form action="" method="post" id="sbc-config">
    
    				</form>
    			</div>
    			<?php
    		}
    
    	}
    
    }
    
    // insert into admin panel
    add_action('admin_menu', array('SBC_Admin', 'add_config_page'));
    
    ?>
  2. Jose Castaneda
    Member
    Posted 9 months ago #

    Are you able to post a link to the tutorial?

  3. vk011
    Member
    Posted 9 months ago #

    Solved. 10 should be 'administrator'.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.