• Resolved XPOL555

    (@xpol555)


    Hi,

    when i enable WP_DEBUG in my wp-config it throws this error:

    Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /demo/metarex/wp-includes/functions.php on line 3547 Notice: wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /demo/metarex/wp-includes/functions.php on line 3547

    https://www.ads-software.com/plugins/wp-nice-scroll-bar/

Viewing 1 replies (of 1 total)
  • Thread Starter XPOL555

    (@xpol555)

    OK guys! I solved this by changing the main php plugin file.
    So in the file wp_nicescrollbar.php (inside the plugin folder) replace from line 19 to 23 with this code:

    /**
     * Enqueue scripts
     *
     * @param string $handle Script name
     * @param string $src Script url
     * @param array $deps (optional) Array of script names on which this script depends
     * @param string|bool $ver (optional) Script version (used for cache busting), set to null to disable
     * @param bool $in_footer (optional) Whether to enqueue the script before </head> or before </body>
     */
    function scrollbar_enqueue() {
    	wp_enqueue_script('wp-nice-scrollbar-main-js', WP_NICE_SCROLLBAR.'js/jquery.nicescroll.min.js', array('jquery'));
    	wp_enqueue_style('nice-scrollbar-custom-css',WP_NICE_SCROLLBAR.'css/nice_scrollbar.css');
    }
    
    add_action( 'wp_enqueue_scripts', 'scrollbar_enqueue',5 );

    this add more compatibility of the plugin to latest wordpress versions, author should change this ??

    Cya!
    Paolo.

Viewing 1 replies (of 1 total)
  • The topic ‘Enableing WP_DEBUG throws an error of enqueue_styles’ is closed to new replies.