Discussion:
Updating wordpress user via php without knowing the userid
Daniel
2014-02-25 01:40:56 UTC
Permalink
Hello all,

I don't know if this belongs here or stackoverflow but I'm just
wondering if anyone know if I can update a user's profile when I don't
know the user id but I do know something that will match up if I use
the *_user_meta stuff.

Thank-you :)

Regards,
Daniel Fenn
Neil Pie's Bacon
2014-02-25 01:42:27 UTC
Permalink
get_user_by() any good?

-----

This email was sent from a mobile device so apologies for any brevity and/or spelling mistakes.
Post by Daniel
Hello all,
I don't know if this belongs here or stackoverflow but I'm just
wondering if anyone know if I can update a user's profile when I don't
know the user id but I do know something that will match up if I use
the *_user_meta stuff.
Thank-you :)
Regards,
Daniel Fenn
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Daniel
2014-02-25 01:47:43 UTC
Permalink
Thank-you for the quick reply, the only thing is that the data is in
the wp_usermeta table. Maybe I should consider moving the data from
wp_usermeta into the wp_users table.
Regards,
Daniel Fenn
Post by Neil Pie's Bacon
get_user_by() any good?
-----
This email was sent from a mobile device so apologies for any brevity and/or spelling mistakes.
Post by Daniel
Hello all,
I don't know if this belongs here or stackoverflow but I'm just
wondering if anyone know if I can update a user's profile when I don't
know the user id but I do know something that will match up if I use
the *_user_meta stuff.
Thank-you :)
Regards,
Daniel Fenn
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
J.D. Grimes
2014-02-25 13:25:47 UTC
Permalink
Try WP_User_Query with a meta query: http://codex.wordpress.org/Class_Reference/WP_User_Query#Custom_Field_Parameters

-J.D.
Post by Daniel
Thank-you for the quick reply, the only thing is that the data is in
the wp_usermeta table. Maybe I should consider moving the data from
wp_usermeta into the wp_users table.
Regards,
Daniel Fenn
Post by Neil Pie's Bacon
get_user_by() any good?
-----
This email was sent from a mobile device so apologies for any brevity and/or spelling mistakes.
Post by Daniel
Hello all,
I don't know if this belongs here or stackoverflow but I'm just
wondering if anyone know if I can update a user's profile when I don't
know the user id but I do know something that will match up if I use
the *_user_meta stuff.
Thank-you :)
Regards,
Daniel Fenn
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Loading...