WP users and forum groups
Quote from xtenz on June 8, 2019, 2:14 pmHi,
I am currently adding and updating my wordpress users from an external database via a sync script.
This works perfectly except that I would also need to update the forum groups belongings.I can’t find in which wp table(s) and/or field(s) these info are stored.
Can you help ?Thank you.
Hi,
I am currently adding and updating my wordpress users from an external database via a sync script.
This works perfectly except that I would also need to update the forum groups belongings.
I can’t find in which wp table(s) and/or field(s) these info are stored.
Can you help ?
Thank you.
Quote from Asgaros on June 9, 2019, 7:27 amHello @xtenz
The usergroup-assignments are stored in the four wp_term* tables as taxonomies/terms for users.
Hello @xtenz
The usergroup-assignments are stored in the four wp_term* tables as taxonomies/terms for users.
Quote from xtenz on June 9, 2019, 4:12 pmHello,
Thank ou for your reply.
Unfortunately I am not familiar with WP database then would you draw me what the relationships are, and highlight the field(s) I should update on the attached file to tick a simple check box ?
This would help me a lot since I really can’t find what to do.
With many thanks.
Hello,
Thank ou for your reply.
Unfortunately I am not familiar with WP database then would you draw me what the relationships are, and highlight the field(s) I should update on the attached file to tick a simple check box ?
This would help me a lot since I really can’t find what to do.
With many thanks.
Quote from Asgaros on June 10, 2019, 12:32 pmHello @xtenz
You can find more information about the term-relationships for the tables here:
Hello @xtenz
You can find more information about the term-relationships for the tables here:
Quote from xtenz on June 10, 2019, 1:05 pmHello
Thank you for your answer, but since I am not a developer simply driving me to the WP support pages (that I had already looked at) does not help me at all :-((
I still can not identify which are the key fields in these tables and on this schema, nor which field I should update and with which value …Could you be more specific please?
Hello
Thank you for your answer, but since I am not a developer simply driving me to the WP support pages (that I had already looked at) does not help me at all :-((
I still can not identify which are the key fields in these tables and on this schema, nor which field I should update and with which value …
Could you be more specific please?
Quote from Asgaros on June 10, 2019, 1:21 pmHello @xtenz
Actually its a little bit tricky:
- wp_term_taxonomy: Here you can find the taxonomies for usergroups and categories (the taxnonomy-name is asgarosforum-usergroup or asgarosforum-category). WordPress assigns IDs to them dynamically (term_id and term_taxonomy_id)
- This term_id value is used in the wp_terms table to define name and slug to it
- This term_id value is also used in the wp_termmeta table to define relevant meta-data for the terms (like colors for usergroups)
- In wp_term_relationships again that term_id (term_taxonomy_id) is connected to an object (e.g. to a user-id for usergroups represented in the object_id field)
The entire data-structure is really confusing – even I need a while to fully understand it completely. Unfortunately, I dont have any influence on it because its provided by WordPress itself.
Hello @xtenz
Actually its a little bit tricky:
- wp_term_taxonomy: Here you can find the taxonomies for usergroups and categories (the taxnonomy-name is asgarosforum-usergroup or asgarosforum-category). WordPress assigns IDs to them dynamically (term_id and term_taxonomy_id)
- This term_id value is used in the wp_terms table to define name and slug to it
- This term_id value is also used in the wp_termmeta table to define relevant meta-data for the terms (like colors for usergroups)
- In wp_term_relationships again that term_id (term_taxonomy_id) is connected to an object (e.g. to a user-id for usergroups represented in the object_id field)
The entire data-structure is really confusing – even I need a while to fully understand it completely. Unfortunately, I dont have any influence on it because its provided by WordPress itself.
Quote from xtenz on June 11, 2019, 2:18 pmHi,
Thank you very much for your help.
I finally made it ! 🙂
I my case I only needed to update the wp_term_relationships table with :
- (object_id) -> (user_id) value coming from wp_usermeta table
- (term_order) -> “0” value
- (term_taxonomy_id) ->”68″ which is the value for the “asgarosforum-usergroup” in wp_term_taxonomy
Once this done, the 3 tables wp_term-taxonomy, wp_termmeta and wp_term tables are automatically updating.
I don’t know if I took this from the right end but it works.
Thank you again.
Hi,
Thank you very much for your help.
I finally made it ! 🙂
I my case I only needed to update the wp_term_relationships table with :
- (object_id) -> (user_id) value coming from wp_usermeta table
- (term_order) -> “0” value
- (term_taxonomy_id) ->”68″ which is the value for the “asgarosforum-usergroup” in wp_term_taxonomy
Once this done, the 3 tables wp_term-taxonomy, wp_termmeta and wp_term tables are automatically updating.
I don’t know if I took this from the right end but it works.
Thank you again.