Closed chrisvanpatten closed 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.
@chrisvanpatten I think you're right; that is probably a better place for that code to exist.
@JJJ I think this is ready for review again!
Fixes #19 and #20
This PR splits
wp_set_terms_for_user
into two functions:wp_set_terms_for_user
contains the basic functionality, interacting withwp_*_object_terms
and the term cachewp_bulk_set_terms_for_user
wraps aroundwp_set_terms_for_user
, with some extra help for handling admin editing contexts (bulk edit and on the user edit screen), such as capability checking, sanitizing keys, and pulling values from the$_POST
globalwp_set_terms_for_user
still supports thebulk
parameter for backwards compatibility, although I did replace those withwp_bulk_set_terms_for_user
in the plugin where appropriate.