WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #9547, comment 15


Ignore:
Timestamp:
08/01/12 11:57:23 (3 years ago)
Author:
simonwheatley
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9547, comment 15

    initial v1  
    44Thanks Sergey. I can see this being more flexible, though it does increase complexity and I wasn't sure if this kind of parameter was in the spirit of the WordPress template tags. I've added it as a separate patch to make things easier to compare (diffing diffs… fun). 
    55 
    6 #9547-sw2.diff demonstrates```get_the_terms``` and ```get_the_term_list``` with the ```$args``` parameter. 
     6```#9547-sw2.diff``` demonstrates```get_the_terms``` and ```get_the_term_list``` with the ```$args``` parameter. 
    77 
    88A further caching caveat with this patch: If you pass an empty array in $args (as is the default) it will cache under a different key to a call where the ```$args``` param contains values equivalent to the defaults in ```wp_get_object_terms```. This is because the patch is MD5 hashing the serialised ```$args``` array. I can't think of a way around this without duplicating the defaults from ```wp_get_object_terms``` in ```get_the_terms``` (and I suspect in most cases the problem is not serious).