how to find user ids of all commenters in a post

The get_comments() answer by Poulomi Nag is correct. This will be somewhat more efficient. global $wpdb, $post; $query = sprintf(“SELECT user_id FROM {$wpdb->comments} JOIN {$wpdb->posts} ON {$wpdb->posts}.ID = {$wpdb->comments}.comment_post_ID WHERE comment_post_ID = %d AND comment_approved = ‘1’”, $post->ID); $authors = $wpdb->get_col($query); $authors = array_unique($authors); $authors = array_diff($authors,array(‘0’)); // Remove those where users are not registered … Read more

Is it possible to get the currently logged in admin’s IP?

This functionality is not directly available, you’ll have to track the logins inside the database(probably as a transient) & check if that transient is available. function check_for_admin() { $user = wp_get_current_user(); if(in_array(‘administrator’, $user->roles)) set_transient(‘admin_ip’, get_ip(), 60*10); } add_action(‘init’, ‘check_for_admin’); After that you can use get_transient(‘admin_ip’) & check if it’s available For retrieving the IP, you … Read more

Custom search form to display users only

I am not going to write your form for you, but create a form and submit it to a page to do the processing, or use the AJAX API. Then use WP_User_Query to actually search for users. It is a very WP_Query-like class that should let you do everything you want including search for user … Read more

Reset WordPress website

One way to solve this would be to set up your demo site exactly how you want it to reset every day (use a standard username and pass like “admin” and “testpass”), and then dump the database and zip the files. Then, put the zip somewhere on your server. Set up a BASH script that … Read more

Disable user profile editing for one user

If you want to completerly remove the possibility for an user to access on profile, you can Give admin possibility to choose which user can access on profile and which not Remove the profile link from menu and from admin bar Ensure the profile is not accessible even if accessed directly by manually typing address … Read more