[wp-trac] [WordPress Trac] #44388: Terms metabox admin autocomplete search don't work with custom taxonomies

WordPress Trac noreply at wordpress.org
Sun Jun 17 18:02:26 UTC 2018


#44388: Terms metabox admin autocomplete search don't work with custom taxonomies
-------------------------------+-----------------------------
 Reporter:  enrico.sorcinelli  |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  REST API           |    Version:  trunk
 Severity:  major              |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 With the [42614] changeset, the ajax tags autocomplete search was replaced
 with REST API search in the admin metabox.

 If I didn't missed something, however, that search don't work anymore with
 custom taxonomies metaboxes.

 The end-point used for the search is always `tagsSuggestL10n.restURL`
 value (`/wp-json/wp/v2/tags`) and the `taxonomy` query param is added with
 the value of custom taxonomy name to search in.
 On the server side the `taxonomy` param don't seem to be handled /
 registerd in collection, so it's ignored at all by returning always search
 over `post_tag` builtin taxonomy.

 The proposal patch try to solve that problem by using `taxonomy` query
 value for `get_items()`.

 In fact, this will transform `/tags` end point (and in general all
 taxonomies end points) as an open proxy end point for all taxonomies even
 for those that are been registered without `sohw_in_rest`.

 Vice-versa, by constrainting the search only to REST exposed taxonomies,
 we could have the incorrect behaviour for term autocompletion in metaboxes
 if the user dont' register custom taxonomy by setting `show_in_rest` to a
 true value.

 At the end, there is the Gutenberg approach that allows to associate terms
 to posts only for REST-exposed custom taxonomies (even if I don't like
 that too much).

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


More information about the wp-trac mailing list