A really nice solution. But what about returning users who already commented on a post? Are they recognized in any way so they don’t have to wait if they want to post another comment?
]]>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
, orinit
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' );
]]>