[wp-trac] [WordPress Trac] #39038: Pass the taxonomy context to singular term capabilities

WordPress Trac noreply at wordpress.org
Sat Dec 3 04:53:55 UTC 2016


#39038: Pass the taxonomy context to singular term capabilities
--------------------------+-------------------
 Reporter:  dd32          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  4.7.1
Component:  Taxonomy      |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-------------------
 As reported in #35614 by @kevinB, the `edit_term`, `delete_term` and
 `assign_term` singular capabilities only pass the `term_id` and not the
 `taxonomy`. For compat with installations where shared terms aren't split,
 we should specify the taxonomy, or trigger splitting.

 > As implemented in 4.7 RC, these meta capability checks accept a term_id
 with no taxonomy specified. This is an issue for legacy installations that
 have term_id != term_taxonomy_id. Taxonomy determination is now slated to
 fall to WP_Term::get_instance(), which will try to disambiguate but may
 return WP_Error.
 > An obvious option would to require the additional taxonomy argument
 following term_id. This would cause a fourth item in the $args array
 passed into the 'map_meta_cap' filter - a break with tradition, but not a
 problem for API-compliant plugins in my view.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39038>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list