comment awaiting moderation

No plug-in needed for this. Just open your theme files using the WordPress theme editor or via FTP. Look for the code that is being used to display the notice. It should be in the index.php file, maybe in a content.php file if your theme uses that, and in some cases it’s in your functions.php … Read more

User’s Comments Number: Storing it in a meta field for different uses

I am using this within a plugin, but it can be used within your theme’s function file. // Create field to track users’ comments numbers function display_educadme_user_comments_number($user_id) { if( is_user_logged_in() ) { global $wpdb; $user_comments_number = $wpdb->get_var(‘SELECT COUNT(comment_ID) FROM ‘ . $wpdb->comments. ‘ WHERE comment_author_email = “‘ . get_comment_author_email() . ‘”‘); ?> <h3><?php _e(‘Participation in … Read more

Query comments with non-empty ‘author_url’ value on Admin Comments Screen

We can set the author_url argument of WP_Comment_Query as null (empty string will not work) to search for comments that don’t have an author url. Currently (ver 4.8.1) the has_author_url isn’t supported. Using a sub-query to exclude those comments, with no author_url, using comment__not_in, should work, but wouldn’t probably scale well. Setting fields as ids … Read more

get Discussion setting in wordpress

this code may help you $status = get_option(‘comment_registration’); // 1 : Yes , user must be registered and logged in for commenting // 0 : No (default) You can use the following code for the comment section if (comments_open($postId)) { if (get_option(‘comment_registration’) == 0 || is_user_logged_in() ){ //render comments section }else{ echo “You must login … Read more

comment_approved custom value

I’d hazard a guess that it isn’t possible — at least not in this exact way — because of that default: return false; part of the code you reference: a custom value of the comment status will hit that and the function will stop immediately. However, have you thought about using a comment metavalue to store … Read more

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