Hot answers tagged

5

In layman terms there is no major difference! update_user_option() uses update_user_meta() internally. The only difference is update_user_option() prefix the option name with database table prefix + blog ID if you are in multisite and just table prefix if you are in single site installation. Take a look at the code of update_user_option() /** * Update ...


5

Both write their data in the “usermeta” table. User options stored in the usermeta table retain the wordpress table prefix e.g. wp_ whereas the user meta also stored in the usermeta table doesn't. User options support blog-specific options, useful in multisite. The user meta is based on the user id specific meta data like profile information. The ...


3

I think you are on the right track, wp_cache_delete was what finally helped me get an auto-signup with auto-login plugin working... I have this from there: wp_cache_delete($current_user->ID, 'users'); wp_cache_delete($current_user->user_login, 'userlogins'); Then see what roles you get after that with: $current_user = wp_get_current_user();


2

Have you tried logging in the user after your changes? Such as: wp_set_current_user( $current_user->ID, $current_user->user_login ); wp_set_auth_cookie( $current_user->ID ); do_action( 'wp_login', $current_user->user_login );


2

Check out the WP_Query reference. For parameters. Date Parameters. $args = array( 'author' => 123 , 'date_query' => array( array( 'after' => 'January 1st, 2013', 'before' => array( 'year' => 2013, 'month' => 2, 'day' => 28, ...


2

wpupdateuser does not appear correct. Is it a compromise? Possibly not if you are allowing user registrations. A Google search for wpupdateuser reveals numerous sites where this username appears. Make sure WP and plugins are up to date.


1

WordPress doesn't do this out of the box. So if you want to know about something that has already happened you're too late :) But if you'd like to know in the future you could for instance have a look at this: https://wordpress.org/plugins/wp-security-audit-log/


1

You cannot query users by taxonomy. You will need to rethink your system. What would I do? Keep the taxonomies but use these only to output choosable values - wp_dropdown_categories() Save the selected value AS user meta, NOT AS taxonomies - update_user_meta() Now you can query users by that value - WP_User_Query() Example: This code would go to the ...


1

WordPress's authentication system is made up of pluggable functions, which means that you can write a plugin that has a function named, say, wp_authenticate(), and your site will use your wp_authenticate() function instead of the native WordPress one. Your comment about is_user_logged_in() (on your original post) is obviated by the fact that ...


1

Is using Auth0 (http://www.auth0.com) maybe an option for you? They have a very good Wordpress plugin. I think you could integrate your system and do a Single Sign On (SSO) using the plugin. I think it's a better option for you to do some stuff on your system to integrate (since you know the system and can probably be more productive), using this ...


1

If you have the ID of the user you can do this: wp_update_user([ 'ID' => $userId, // this is the ID of the user you want to update. 'first_name' => $firstName, 'last_name' => $lastName, ]); You can update / insert almost all fields with this function. Take a look at the documentation here


1

Based on your comments, you should choose option 2 (using special template files). You can do that multiple ways, but I suggest you do the following: Create a plugin that will setup login, register, retrieve password, profile, delete account, and other related pages; (there will be a lot of pages). Creating a plugin is just a suggestion, but I prefer doing ...



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