Posting XML in comment section

If you’re wanting your users to be able to add the xml tags into the comment form, without having them removed, it would be best to add a filter to pre_process_comment so as to add <pre> tags around the comment before it’s posted to the DB.

WordPress Comments – Only show part of user name

You have to dive into comment template in your theme and find out the line where username is printed. Then use the following function in functions.php: function alter_username( $username ){ return substr( $username, 0, 1 ). str_repeat( ‘*’, strlen( $username ) – 2 ) . substr( $username, strlen( $username ) – 1 ,1 ); } … Read more

Redirect first time comments

Since the comment form is generated before the comment is submitted that won’t work too well logically. The better option is comment_post_redirect filter: /** * Filter the location URI to send the commenter after posting. * * @since 2.0.5 * * @param string $location The ‘redirect_to’ URI sent via $_POST. * @param object $comment Comment … Read more

Current user comments + post title

You can get the title of a post if you have the post ID and every comment is assigned to a post ID. So basically, just use the comment_post_ID + get_the_title() function: get_the_title($c->comment_post_ID);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)