Support » Plugin: Widgets Controller » [Plugin: Widgets Controller] Notice error on plugin activation

  • joelchristopher

    (@joelchristopher)


    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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • vkkanani11

    (@vkkanani11)

    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

    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' ) ) );
    }

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Widgets Controller] Notice error on plugin activation’ is closed to new replies.