Opened 6 years ago
Closed 6 years ago
#48251 closed defect (bug) (fixed)
Remove "private" assignation from _deprecated_...() and _doing_it_wrong()
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.4 | Priority: | normal |
Severity: | normal | Version: | 5.3 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
`_deprecated_function()` was introduced in WP 2.5.0 via [6514] in response to #4361
`_deprecated_file()` was introduced in WP 2.5.0 via [6514] in response to #4361
`_deprecated_argument()` was introduced in WP 3.0.0 via [12536] in response to #11386
`_doing_it_wrong()` was introduced in WP 3.1.0 via [16939] in response to #15824
`_deprecated_constructor()` was introduced in WP 4.3.0 via [32989] in response to #31982
All of these functions are currently marked as private
.
I have not been able to discover why they were marked as private
in the first place, but not withstanding that, they are widely used by plugins (13249 matches) and themes (13512 matches) anyway.
In contrast, `do_action_deprecated()` and `apply_filters_deprecated()` are not marked private
.
Aside from this being inconsistent, IMO, it also doesn't make sense.
Why would plugins and themes not be allowed to use these functions to throw appropriate error notices when (add-on) plugins and (child) themes would be using functionality which the plugin/theme has deprecated ?
So, with this ticket I'd like to propose removing the private
assignation from the above mentioned functions.
N.B.: I'm explicitly excluding `_deprecated_hook()` from this ticket as that function really shouldn't be called directly, but is invoked under the hood by the do_action_deprecated()
and apply_filters_deprecated()
functions.
Remove private assignation from _deprecated_..() and _doing_it_wrong() functions