[wp-trac] [WordPress Trac] #26869: Hook Docs clean up

WordPress Trac noreply at wordpress.org
Thu May 8 12:08:28 UTC 2014


#26869: Hook Docs clean up
----------------------------+-----------------------------
 Reporter:  DrewAPicture    |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  Future Release
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:  docs
----------------------------+-----------------------------

Comment (by GaryJ):

 I'm not in favour of r28349 as it stands.

 Looking at just one of them:

 {{{
 /**
  * Fires the requested handler action for logged-out users.
  *
  * The dynamic portion of the hook name, $action, refers to the handler
 action.
  *
  * @since 2.6.0
  */
 do_action( "admin_post_nopriv{$action}" );
 }}}

 Imagine that is taken out of context and shown on devhub. That now looks
 like I can provide a handler action of `foobar` and I can hook into the
 `admin_post_noprivfoobar` hook. There's no mention that `$action` is given
 an underscore prefix in the hook doc, or perhaps worse, the hook name
 doesn't reflect that the (missing) underscore is static and always
 present.

 I think here I'd rather see four explicit hooks that are clearly named and
 unambiguous, than two that are misnamed and don't ''appear'' to follow the
 naming consistency of other dynamic hooks.

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


More information about the wp-trac mailing list