[wp-trac] [WordPress Trac] #10441: Show warning when deprecated hook is registered

WordPress Trac noreply at wordpress.org
Sat Jun 11 16:16:08 UTC 2016


#10441: Show warning when deprecated hook is registered
------------------------------------+---------------------------
 Reporter:  sirzooro                |       Owner:  boonebgorges
     Type:  feature request         |      Status:  accepted
 Priority:  normal                  |   Milestone:  4.6
Component:  Plugins                 |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |     Focuses:
------------------------------------+---------------------------

Comment (by DrewAPicture):

 I think we'd actually do well to also add an `@deprecated` tag to the hook
 docs as well, as there's already logic in place to display a callout box
 on the Code Reference for elements marked as such. I'd have to check, but
 I think that might be dumb to the post type.

 The thinking is that while we could simply map the
 `apply_filters|do_action_deprecated()` calls to assign the "deprecated"
 meta/term for an item, it lowers the maintenance burden to simply
 deprecate hooks (from a documentation perspective) exactly the same way
 that we do other elements like functions and methods.

 In the case of replacements, we'd need to include that information in the
 `@deprecated` and/or additional `@see` tag so that the deprecation callout
 knows where to point – again, logic is already in place to handle that,
 we'd just need to slightly tweak the inline docs standard, e.g.


 {{{#!php
 <?php
  * @deprecated 4.6.0 Use 'replacement_hook' instead.
  * @see 'replacement_hook'
 }}}

 Should output something like this:

 [[Image(http://cl.ly/1S1p3f2M3s0E/Screen%20Shot%202016-06-11%20at%2010.07.21%20AM.png)]]

 As for the other changes to the parser, that shouldn't be a problem. I
 don't any issue with adjusting it to route more functions to the hook post
 type.

 I'll get started on a corresponding meta ticket for any changes that need
 to happen in the wporg-developer theme and a PR for the parser. The nice
 part is that we don't re-parse until after release so we'd have some time
 to get the meta/parser changes in place.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/10441#comment:30>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list