Please or Register to create posts and topics.

WP users and forum groups

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.

Hello @xtenz

The usergroup-assignments are stored in the four wp_term* tables as taxonomies/terms for users.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

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.

Uploaded files:
  • Capture-d’écran-2019-06-09-à-15.57.03.png
  • Capture-d’écran-2019-06-09-à-16.05.08.png

Hello @xtenz

You can find more information about the term-relationships for the tables here:

https://developer.wordpress.org/themes/basics/categories-tags-custom-taxonomies/#database%c2%a0schema

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

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?

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.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

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.

Asgaros has reacted to this post.
Asgaros