Closed chrisvanpatten closed 6 years ago
wp_set_terms_for_user runs the array of $terms through sanitize_key:
wp_set_terms_for_user
$terms
sanitize_key
https://github.com/stuttter/wp-user-groups/blob/master/wp-user-groups/includes/functions/common.php#L74
This causes an array of (int) term_ids to be cast to strings, which in turn causes wp_set_object_terms to add new terms with the IDs as the term names.
(int) term_id
wp_set_object_terms
Confirmed.
I wonder if we are better off removing that line, and letting wp_set_object_terms() sort it out entirely?
wp_set_object_terms()
wp_set_terms_for_user
runs the array of$terms
throughsanitize_key
:https://github.com/stuttter/wp-user-groups/blob/master/wp-user-groups/includes/functions/common.php#L74
This causes an array of
(int) term_id
s to be cast to strings, which in turn causeswp_set_object_terms
to add new terms with the IDs as the term names.