[wp-trac] [WordPress Trac] #25474: Hooks Docs: wp-admin/includes/nav-menu.php

WordPress Trac noreply at wordpress.org
Thu Oct 3 01:17:03 UTC 2013


#25474: Hooks Docs: wp-admin/includes/nav-menu.php
--------------------------+------------------------------
 Reporter:  Faison        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Inline Docs   |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by DrewAPicture):

 Replying to [comment:1 Faison]:
 > I have a quick question: In this file, the filter
 `nav_menu_meta_box_object` occurs twice, but with different parameters,
 should the second occurrence be documented as `//duplicate_hook` instead
 of how I have it in my patch?
 >
 > Thanks,
 > Faison

 Since actions and filters can be used in multiple places, they still
 always accept the same things but in different contexts. So in the case of
 this hook, it accepts an `object`. It's up to the documentation to spell
 out what kind of objects it accepts, in this case that would be a post
 type or taxonomy object.

 And since any later uses of the hook will be labeled `//duplicate_hook`
 it's a good idea to outline the various contexts in the main docblock.
 Something like:
 {{{
 @param object $post_type A nav menu meta box object, such as Page, Post,
 Category, Tag, etc. Accepts a post type or taxonomy object.`
 }}}

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25474#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list