stuttter / wp-user-groups

Group users together with taxonomies & terms
https://wordpress.org/plugins/wp-user-groups/
GNU General Public License v2.0
48 stars 22 forks source link

Split wp_set_terms_for_user for bulk/non-bulk contexts #21

Closed chrisvanpatten closed 6 years ago

chrisvanpatten commented 6 years ago

Fixes #19 and #20

This PR splits wp_set_terms_for_user into two functions:

wp_set_terms_for_user still supports the bulk parameter for backwards compatibility, although I did replace those with wp_bulk_set_terms_for_user in the plugin where appropriate.

chrisvanpatten commented 6 years ago

@jjj based on your comment in #19 if the sanitize step is removed (which makes sense to me) all that's left in the bulk-specific method is the capability check and pulling values from $_POST… and maybe, to be honest, those are better placed directly in the User_Taxonomy class than in a wrapper function?

Happy to rework if you think that makes sense.

JJJ commented 6 years ago

@chrisvanpatten I think you're right; that is probably a better place for that code to exist.

chrisvanpatten commented 6 years ago

@JJJ I think this is ready for review again!