Set user after wp_create_user?

Here is a function I wrote that hooks into the gravity forms create user form but it can be added to whatever action hook your wp_create_user function is attached to. function my_auto_login( $user_id ) { wp_set_auth_cookie( $user_id, false, is_ssl() ); wp_redirect( admin_url( ‘profile.php’ ) ); exit; } The important part is wp_set_auth_cookie. This has to … Read more

Show Biographical Info while creating new user

No. There are no hooks or filters to add an input field to the create user form. Maybe it is possible to add an input field via jQuery. I have not tested it. If it is pssible to add an input field, than it should be possible to save this information because the process of … Read more

pre_user_query meta_query admin user list

You are using pre_user_query according to WordPress documentation Fires after the WP_User_Query has been parsed, and before the query is executed Then you should use pre_get_users just like pre_get_posts when your arguments have some meaning to WordPress. pre_get_users Fires before the WP_User_Query has been parsed Replace your hook with add_action(‘pre_get_users’, ‘modify_user_list’);

Remove all users from site except one using WP CLI

Found out you can pass the –exclude option to wp user list to exclude a user by their ID from the list. So let’s assume your user ID is 2 then you could do the following: wp user delete $(wp user list –field=ID –exclude=2) And just to be sure all content gets reassigned to you … Read more

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