WordPress.org

Forums

Widgets Controller
Notice error on plugin activation (4 posts)

  1. joelchristopher
    Member
    Posted 2 years ago #

    This notice shows up at top of all pages after I installed and activated your plugin. Is there a fix?

    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 init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/rw/public_html/wp-includes/functions.php on line 2748

    http://wordpress.org/extend/plugins/widgets-controller/

  2. vkkanani11
    Member
    Posted 2 years ago #

    Hi joelchristopher,

    there is no wordpress version problem but i think wp_enqueue_script function is conflict with another plugin function in your plugin directory.
    http://wordpress.org/support/topic/plugin-google-custom-search-notice-wp_enqueue_script-was-called-incorrectly

  3. fburatti
    Member
    Posted 2 years ago #

    line 19 replace

    wp_enqueue_script( 'my-ajax-request', plugin_dir_url( __FILE__ ) . 'widgets_controller.js', array( 'jquery' ) );
    wp_localize_script( 'my-ajax-request', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );

    with

    add_action('admin_enqueue_scripts','register_my_scripts');
    
    function register_my_scripts(){
    wp_enqueue_script( 'my-ajax-request', plugin_dir_url( __FILE__ ) . 'widgets_controller.js', array( 'jquery' ) );
    wp_localize_script( 'my-ajax-request', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
    }
  4. ronr1999
    Member
    Posted 2 years ago #

    Thanks for that. Had this problem with MultiSite. The author should fix this...

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Widgets Controller
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.