Support » Plugin: NextGEN Custom Fields » [Plugin: NextGEN Custom Fields] Minor tweak to fix has_cap messages in debug.log

  • Hi Shaun,

    In the nggcf_admin_menu function there’s a small but noisy issue due to numeric user levels being deprecated. It doesn’t break anything but it does clutter up my debug.log with this cryptic message about a dozen times per page load:

    PHP 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 /media/CNT/wired/wired-blogs/publish/wiredscience/wp-includes/functions.php on line 3551

    After much searching I found out that this means that WordPress no longer likes numeric values for the capability when adding a menu or submenu. The fix is to use ‘manage_options’ in place of the number 8 for the menu’s capability, like this:

    function nggcf_admin_menu() {
        add_menu_page("NextGEN Gallery Custom Fields", "NGG Custom Fields", 'manage_options', __FILE__, "nggcf_plugin_options");
        add_submenu_page(__FILE__, "Setup NextGEN Gallery Custom Fields", "Setup Fields", 'manage_options', __FILE__, "nggcf_plugin_options");
    }

    Again, this doesn’t break anything so it won’t even be noticed by anyone but us other developers. 🙂

    – Kathy

    http://wordpress.org/extend/plugins/nextgen-gallery-custom-fields/

Viewing 1 replies (of 1 total)
  • Plugin Author shauno

    (@shauno)

    Hey Kathy

    Thanks for the heads up. I have updated the code to the string ‘manage_options’. Let me know if you have any more problems.

    And thank you very much for the donation, it’s always appreciated! 😀

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: NextGEN Custom Fields] Minor tweak to fix has_cap messages in debug.log’ is closed to new replies.