Adding restrictions to open comments

All you need is to simply check if the entered name or email matched any admin accounts before the comment is saved. function restrict_admin_names() { if ( !is_user_logged_in() ) { $name = $_POST[‘author’]; // Get Submitted Name $email = $_POST[’email’]; // Get Submitted Email $admins = get_super_admins(); // Get an array of admin login $adminemail[] … Read more

Get Commentor IP When Marking Comment As Spam

You are missing 2 parameters in your function report_spam. Also the priority should not be 1. Try the code below. add_action(‘transition_comment_status’, ‘report_spam’, 10, 3); function report_spam($new_status, $old_status, $comment){ if($new_status == ‘spam’){ var_dump($comment->comment_author_IP); die; } } I’ve set die so that you can check and manipulate what you want.

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