Relaxing unescaped HTML filtering inside tags?

a small solution; the highlighting was in my blog via javascript function pre_esc_html($content) { return preg_replace_callback( ‘#(<pre.*?>)(.*?)(</pre>)#imsu’, create_function( ‘$i’, ‘return $i[1].esc_html($i[2]).$i[3];’ ), $content ); } add_filter( ‘the_content’, ‘pre_esc_html’, 9 );

Notify multiple email addresses on comments

Post authors are notified of new comments by default; there are several plugins that modify this behavior. See wp_notify_postauthor. You can hook into comment_notification_recipients and add an aribtrary list of recipients as described here. Then you could create a metabox or dashboard widget to manage the recipient list. Keep in mind that this functionality might … Read more

How can I highlight admin comments?

By default WordPress already adds user/admin/post author specific CSS to comments with the following three elements. #byuser #comment-author-admin .bypostauthor So you can just add something like #comment-author-admin {background-color;blue;} to your stylesheet.

If new comment posted in custom post – send notification to custom email from custom field

You can try something like this in your functions.php function send_comment_email_notification( $comment_ID, $commentdata ) { $comment = get_comment( $comment_id ); $postid = $comment->comment_post_ID; $master_email = get_post_meta( $postid, ‘master_email’, true); if( isset( $master_email ) && is_email( $master_email ) ) { $message=”New comment on <a href=”” . get_permalink( $postid ) . ‘”>’ . get_the_title( $postid ) . … Read more

How to edit user_id on the comment edit screen

You can take reference from below code. It will provide an option to update user id of comment (https://prnt.sc/s57q4f). paste below code in active theme’s functions.php file.I have tested and it is working for me. let me know if it works for you. # comment user id update metabox function action_add_meta_boxes_comment( $comment ) { ?> … Read more

Intercept comment form submit/list by hook/filter

wp_list_comments() has no filters or hooks so its going to be a bit hard, what you can do is use comments_array filter hook add_filter(‘comments_array’,’my_custom_comments_list’); function my_custom_comments_list($comments, $post_id){ //if criteria are met //pull your comments from your own table //in to an array and return it. return $my_comments; //else return $comments } and as for “intercept … Read more

How to prevent spam comments?

+1 for akismet http://wordpress.org/extend/plugins/cookies-for-comments/ Is also amazing. Akismet is great at catching spam, but adding cookies for comments is awesome. It stops a lot of the auto-posted spam. (Which most of it is) Cookies for comments will stop the comment before it even gets to you. Akismet was catching 50 spams a day for me. … Read more

Hide comments awaiting moderation from user who submitted the comments

Check in your theme’s comments.php for the wp_list_comments() function. In the Twenty Eleven theme, for example, uses a custom callback function which is in the functions.php file and outputs the template for comments. Within this comments template, you can then use wp_get_comment_status() and only display a comment if it was approved. Example from the Codex: … Read more

How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?

pre_get_posts is executed before each and every query. Your $query->is_main_query() is making this code change the query only for the Main query. So, if you’re in an archive page, you’re modifying only the archive posts, and not any of the others queries (widgets, menus, etc). But be aware, that code you added there will change … Read more

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