WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Custom Fields
Minor tweak to fix has_cap messages in debug.log (2 posts)

  1. Katherine Semel-Munson
    Member
    Posted 2 years ago #

    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/

  2. shauno
    Member
    Plugin Author

    Posted 2 years ago #

    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! :D

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic