Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #33369, comment 3


Ignore:
Timestamp:
08/14/2015 12:37:51 AM (8 years ago)
Author:
knutsp
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33369, comment 3

    initial v1  
    11It could be argued that a function using defaults should return the same result when the argument was explicit and equal to the default, as when (deliberately) omitted. My trust in the documentation of a function would be damaged if I found this not to be true.
    22
    3 In other words, I think `get_terms( 'mytax', array( 'ordery' => 'name' ) )` and `get_terms( 'mytax' )` should return the same results when called in the same context, regardless of any filter.
     3In other words, I think `get_terms( 'mytax', array( 'orderby' => 'name' ) )` and `get_terms( 'mytax' )` should return the same results when called in the same context, regardless of any filter.
    44
    55That is why I'm not sure that filters really should be informed on how the arguments was given, only their value after merging with defaults. The way WordPress uses `wp_parse_args()` resembles that of PHP when using optional arguments.