Hide a user from WordPress

You’re wanting to hide a user from WordPress in three places: The user list in the admin The count above that user list The user’s author archive on the front-end As you mentioned, you’ve already solved item 1 and you’ve included the code for that. So, I’ll provide the solutions for items 2 and 3. … Read more

How to count get_users query?

when you use get_users() it retrieves an array of users matching the criteria given in $args which means you can simply use PHP’s count() function e.g: $users = get_users($args); $number_of_users = count($users);

how to get recent registered author id?

I don’t think you need any SQL queries. <?php $args = array( ‘role’ => ‘author’, // authors only ‘orderby’ => ‘registered’, // registered date ‘order’ => ‘DESC’, // last registered goes first ‘number’ => 1 // limit to the last one, not required ); $users = get_users( $args ); $last_user_registered = $users[0]; // the first … Read more

Extend the wp_users table

There are far better ways of doing this. Instead of modifying the user table, make use of User Meta. It has a dedicated table, and works the same way as post meta, but for users. add_user_meta get_user_meta update_user_meta There are many tutorials explaining how to add additional fields to the user profile using User meta … 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

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