WordPress.org

Make WordPress Core

Opened 2 weeks ago

Last modified 2 weeks ago

#48251 new defect (bug)

Remove "private" assignation from _deprecated_...() and _doing_it_wrong()

Reported by: jrf Owned by:
Milestone: 5.4 Priority: normal
Severity: normal Version: trunk
Component: General Keywords: has-patch
Focuses: Cc:
PR Number:

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.

Attachments (1)

48251.patch (2.6 KB) - added by jrf 2 weeks ago.
Remove private assignation from _deprecated_..() and _doing_it_wrong() functions

Download all attachments as: .zip

Change History (2)

@jrf
2 weeks ago

Remove private assignation from _deprecated_..() and _doing_it_wrong() functions

#1 @SergeyBiryukov
2 weeks ago

  • Milestone changed from Awaiting Review to 5.4
Note: See TracTickets for help on using tickets.