• Resolved jumbo

    (@jumbo)


    Thanks for this plugin. It’s reporting the following within the admin area:

    Notice: wp_register_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.0.) in \home\test\web\wp\wp-includes\functions.php on line 4139

    This error notice is printed on every page in the admin area, which also prevents the “Attachment Details” popup from opening in grid view.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Claude Vedovini

    (@cvedovini)

    Never saw that before, what makes you think it’s coming from that plugin?

    Thread Starter jumbo

    (@jumbo)

    Hi @@cvedovini,

    I tried it on a clean install with the following with WP_DEBUG enabled. It’s coming from the line below:

    
    // File: /wp-content/plugins/better-image-credits/class-admin.php
    class BetterImageCreditsAdmin {
        function __construct($plugin) {
            // Commenting out the line below makes the NOTICE go away:
            wp_register_script('credits-admin', plugins_url('admin.js', __FILE__), array('jquery-ui-autocomplete'), '1.0', true);
        }
    }
    

    Thanks.

    Plugin Author Claude Vedovini

    (@cvedovini)

    I just released a new version that should fix that notice, thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Notice: wp_register_script was called incorrectly.’ is closed to new replies.