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 );

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 enable comments options?

Go to the page.php template of your theme and check if <?php comments_template(); ?> is added there. If it isn’t, then you need to add this line below your page content rendering section.

How to move comments form above comments list in wordpress

The if (have_comments()) { … } checks whether there is any comment on your post, and starts a loop to display them. The comment_form() function is responsible to render the comment form. So, if you want to swap their positions, you should swap these two. But, you should make sure you move both comment_form() and … Read more

Why Allow Script Commands in Comments?

It is not “security risk” per se, as an admin can just go and add whatever stupid PHP code it likes via FTP which usually can do much more damage than some JS. If an admin does stupid things then there is nothing you should do about it as after all it is his site. … Read more

How can I show comments in random order?

Never actually had a need for this but you will need to use the WP_Comment_Query function. There is this handy comments query generator online to customize this query easily. But wait, it doesn’t allow you to select a random order. No worries just add or replace the orderby parameter: ‘orderby’ => ‘rand’ This should return … Read more

get_comments() where parent is not 0

You cannot do that with a parameter for get_comments(), but filtering ‘comments_clauses’ should do it. Sample code, not tested: add_filter( ‘comments_clauses’, ‘wpse_78490_child_comments_only’ ); function wpse_78490_child_comments_only( $clauses ) { $clauses[‘where’] .= ‘ AND comment_parent != 0’; return $clauses; }

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