[wp-trac] [WordPress Trac] #48251: Remove "private" assignation from _deprecated_...() and _doing_it_wrong()

WordPress Trac noreply at wordpress.org
Tue Oct 8 11:39:34 UTC 2019


#48251: Remove "private" assignation from _deprecated_...() and _doing_it_wrong()
--------------------------+-----------------------------
 Reporter:  jrf           |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:  has-patch
  Focuses:                |
--------------------------+-----------------------------
 [https://developer.wordpress.org/reference/functions/_deprecated_function/
 `_deprecated_function()`] was introduced in WP 2.5.0 via [6514] in
 response to #4361
 [https://developer.wordpress.org/reference/functions/_deprecated_file/
 `_deprecated_file()`] was introduced in WP 2.5.0 via [6514] in response to
 #4361
 [https://developer.wordpress.org/reference/functions/_deprecated_argument/
 `_deprecated_argument()`] was introduced in WP 3.0.0 via [12536] in
 response to #11386
 [https://developer.wordpress.org/reference/functions/_doing_it_wrong/
 `_doing_it_wrong()`] was introduced in WP 3.1.0 via [16939] in response to
 #15824
 [https://developer.wordpress.org/reference/functions/_deprecated_constructor/
 `_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
 [https://wpdirectory.net/search/01DPNAN2BZK1NJBHRYNQC574CN plugins] (13249
 matches) and [https://wpdirectory.net/search/01DPNANBNHTP96C397M2H2EA6B
 themes] (13512 matches) anyway.

 In contrast,
 [https://developer.wordpress.org/reference/functions/do_action_deprecated/
 `do_action_deprecated()`] and
 [https://developer.wordpress.org/reference/functions/apply_filters_deprecated/
 `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
 [https://developer.wordpress.org/reference/functions/_deprecated_hook/
 `_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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48251>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list