Creating custom AJAX requests

In WordPress the way of handling Ajax calls is a bit different the plain PHP but still very simple, all ajax calls should be to wp-admin/admin-ajax.php and you just define your own functions by hooks, Take a look at What’s the preferred method of writing AJAX in WordPress

Data Validation

Is ‘sql injection’ already a part of that function or do I need to add my own code? When inserting input to the database you should use prepare method of WPDB class which supports both a sprintf() – like and vsprintf() -like syntax. read more at the codex Are there wordpress form input validation functions … Read more

Comment form vaildation

Ok, I’ve worked this out. You need to copy the complete first section of the `comment_form()’ from wp core. This is the code <?php function comment_form( $args = array(), $post_id = null ) { if ( null === $post_id ) $post_id = get_the_ID(); else $id = $post_id; $commenter = wp_get_current_commenter(); $user = wp_get_current_user(); $user_identity = … Read more