Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #26948, comment 3


Ignore:
Timestamp:
01/27/2014 03:57:06 PM (11 years ago)
Author:
hlashbrooke
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26948, comment 3

    v1 v2  
    11I agree that the whole thing needs some general love for sure, so if this patch doesn't fit into the bigger picture for quick edit then I'm happy to drop it.
    22
    3 My original idea was to filter the taxonomy array, but each element of the array is an object, which meant the filter received an array of taxonomy objects making it slightly more complicated to filter. I ended up doing it inside the foreach, but I think you're right - filtering `$taxonomy_names` would probably be a better option. I'll update the patch for that :)
     3My original idea was to filter the taxonomy array, but each element of the array is an object, which meant the filter received an array of taxonomy objects making it slightly more complicated to filter. There would be a similar problem with `$taxonomy_names` - it returns an array of names with a numeric index, so in order to filter the list you would need to loop through the array or use `array_search()` or something similar. By doing it in the `foreach` it means your filter function simply needs a quick conditional and a boolean result, which is much friendly for the end-user I think.
    44
    55Adding a `'quick_edit' => true` type of argument to `register_taxonmy()` might be a better option - I had considered that, but thought of going for a less intrusive approach for the first pass.