Support » Plugin: Auto Post to Social Media - WordPress to Buffer » Depreciated code and notices: has_cap was called and undefined index

  • Resolved Vidyut

    (@vidyut)


    When you turn on debug, you get this notice “Notice: has_cap was called with an argument that is deprecated since version 2.0! “

    The plugin works, but it is using depreciated user levels instead of the new user roles. To fix, change “9” in the following line in wp-to-buffer.php :

    add_menu_page($this->plugin->displayName, $this->plugin->displayName, 9, $this->plugin->name, array(&$this, 'AdminPanel'), $this->plugin->url.'images/icons/small.png');

    to

    add_menu_page($this->plugin->displayName, $this->plugin->displayName, 'activate_plugins', $this->plugin->name, array(&$this, 'AdminPanel'), $this->plugin->url.'images/icons/small.png');

    To fix the notice “Notice: Undefined index: page in /path/to/wordpress/wp-content/plugins/wp-to-buffer/wp-to-buffer.php on line 116” change:

    if ($_GET['page'] == $this->plugin->name) return false;

    to

    if ((isset($_GET['page'])) && $_GET['page'] == $this->plugin->name) return false;

    http://wordpress.org/plugins/wp-to-buffer/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Depreciated code and notices: has_cap was called and undefined index’ is closed to new replies.