Tag Info

Hot answers tagged

2

In following to my comments on the question the follow examples for a solution. Default Function WordPress have the function get_users to get all users for each site, works on single or multisite area. But to get all users from each site in Multisite network is the switch to each site important. The follow example demonstrate this. // Multisite // get ...


1

It should work but it doesn't add even the tiniest security to the site (if the bad guy has enough permissions to alter the password of the admin he can probably create an admin user for himself). Don't forget to backup before running the queries.


1

Despite that this approach may be flawed by the fact that it can be by-passed using proxies, here is a simplistic (yet untested) approach, which you would need to improve upon but would give you the foundation for achieving your desired goal. The process as I see it: filter user registerations on the pre_user_login or pre_user_nicename hooks check ...


1

Why not make a new account for this user which will generate a new database ID. Then delete the user with the ID of 1 and attribute all posts / content to the new user you created for them? Then you don't have to worry about queries or messing up your database. Also, as said before this makes absolutely no sense from a security standpoint as it's pointless. ...


1

I would highly recommend Daniel's much simpler solution over the one currently selected as correct: $user = get_userdata( $user_id ); if ( $user === false ) { //user id does not exist } else { //user id exists }


1

It seems that my edit to your answer was declined, so here you go. All that was missing was the $priority and $accepted_args parameters for the add_action() calls, and the the fixed code below should accomplish what you require. remove_action( 'add_option_new_admin_email', 'update_option_new_admin_email' ); remove_action( 'update_option_new_admin_email', ...


1

If you didn't want to go a plugin route you could build it directly into your theme using default wordpress actions. The first function will create new sections on the user profile screen and the 2nd function will add/remove from the default user profile settings. add_action( 'show_user_profile', 'be_show_extra_profile_fields' ); add_action( ...



Only top voted, non community-wiki answers of a minimum length are eligible