[wp-trac] [WordPress Trac] #11386: New _deprecated_argument() function (was: Remove $deprecated = '' arguments that don't affect argument order)
WordPress Trac
wp-trac at lists.automattic.com
Thu Dec 24 09:29:38 UTC 2009
#11386: New _deprecated_argument() function
-------------------------+--------------------------------------------------
Reporter: nacin | Owner: westi
Type: enhancement | Status: accepted
Priority: normal | Milestone: 3.0
Component: Inline Docs | Version:
Severity: normal | Keywords: needs-review
-------------------------+--------------------------------------------------
Changes (by nacin):
* keywords: needs-patch => needs-review
Comment:
Patches added. Some things I came across -
1. I wished we could just pass the value of the argument to the function
and check {{{!empty()}}} there, but there are enough arguments that expect
true (many of them in the sample patch), so it would either unnecessarily
complicate _deprecated_argument() or result in a hack when calling it:
{{{_deprecated_argument(__FUNCTION__, 'deprecated_echo', $deprecated_echo
=== true ? null : true, '0.0', 'the other function')}}}. I went with
manually checking in each function.
2. I wanted to do ordinal numbers for deprecated arguments (with the
option to specify a string argument name as well), as nearly all have been
renamed to 'deprecated' (and should stay that way, IMO), such that it says
"The ''third'' argument of get_option() is deprecated since version 0.0
with no alternative available."
This is good feedback especially since keeping these is partly to maintain
argument order if we ever add more arguments. But conditional ordinals
complicates translations if not making them impossible in some languages,
so I'd like to hear some feedback first. (We could always do "Argument 1
...") These approaches also might complicate a function running on a hook,
as they'll expect an argument name.
3. Version numbers will require blame. Once reviewed and ready to patch
across core, I'll go ahead and look them up.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11386#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list