Is there a way to override or map WP_User ?
-
Hi all, on my first adventure in WP plugin development and need some guidance and expertise from the gurus. I’ve made some headway into integrating WordPress with another PHP app with the intent to use WordPress as a CMS.
I’m a little torn on what strategy to use for integrating the userbases of the two platforms.
For right now, I’m essentially just running wp_create_user and storing redundant information in the WP database which includes user metadata that syncs with the user ID of the other app. However, the idea of keeping two copies of essentially same data bugs me.
So I’m wondering what other strategies exist for user integration between systems.
Is there a way to “override” or custom map the WP_User where I can put an interface or filter in front of WP_user so that whenever WordPress attempts to get user information, it goes through my custom interface so that I can manipulate the data as needed (and by this I mean just mapping the data from the other app to match what WP_User properties)?
I was thinking about extending WP_User class but then I’m still unsure how I could plug the new class into everything.
I was able to do this with comments by using the ‘comments_array’ filter to create my own stdClass object to return but I couldn’t find any filters for the user data.
Appreciate any pointers! Thanks!
- The topic ‘Is there a way to override or map WP_User ?’ is closed to new replies.