WordPress.org

Ready to get started?Download WordPress

Forums

CommentCaVa
PHP Notice: wp_enqueue_script was called inccorectly (1 post)

  1. J.D. Grimes
    Member
    Posted 1 year ago #

    You need to call wp_enqueue_script() inside of the 'wp_enqueue_script' action hook. Right now you'll get this error if you have WP_DEBUG on:

    PHP 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.)

    Example:

    function comment_ca_va() {
    
         wp_enqueue_script( "CommentCaVa", plugins_url() . "/CommentCaVa/CommentCaVa.js" );
    }
    add_action( 'wp_enqueue_script', 'comment_ca_va' );

    http://wordpress.org/extend/plugins/commentcava/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic