Hi,
I found a bug in the relationship between a custom taxonomy and the users.
I have a custom taxonomy ‘genres’ with an assigned field group with a field for assigned users.
Name: ‘rel_users’
Field Type: User
Select Multiple: True
Bidirectional Target Field: rel_genres
A second field group is assigned to ‘users’ and has a field for assigned taxonomy.
Name: ‘rel_genres’
Field Type: Taxonomy
Appearance: Multi Select
Bidirectional Target Field: rel_users
If I assign a user to a genre term, everything is ok.
term_id: 15
user_id: 5
wp_usermeta
meta_key: rel_genres
meta_value: a:1:{i:0;s:2:”15″;}
wp_termmeta
meta_key: rel_users
meta_value: a:1:{i:0;s:1: “5”;}
In the backend the relations are displayed correctly in the user profile and on the taxonomy edit page.
However, when I make changes on the taxonomy edit page, the target value is changed incorrectly (when I delete, save and reassign the user) so that the assignment in the user profile disappears. When saving the taxonomy term, the bidirectional target field is now saved as an interger array instead of string array.
wp_usermeta
meta_key: rel_genres
meta_value: a:1:{i:0;i:15;} <- integer array!
wp_termmeta (unchanged)
meta_key: rel_users
meta_value: a:1:{i:0;s:1: “5”;}
It seems that the array with integer values destroys the relationship on the side of the user.
best regards
steffen