Opened 12 years ago
Closed 12 years ago
#25474 closed defect (bug) (fixed)
Hooks Docs: wp-admin/includes/nav-menu.php
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.8 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Inline Docs | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Attached patch has docs for the filters
nav_menu_meta_box_object
nav_menu_items_{$post_type_named}
wp_edit_nav_menu_walker
And actions:
wp_update_nav_menu
Attachments (3)
Change History (8)
#1
follow-up:
↓ 2
@
12 years ago
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
#2
in reply to:
↑ 1
@
12 years ago
Replying to 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.`
#3
@
12 years ago
- Keywords needs-patch added; has-patch removed
- Owner set to DrewAPicture
- Status changed from new to reviewing
#4
@
12 years ago
- Keywords has-patch commit added; needs-patch removed
- Milestone changed from Awaiting Review to 3.8
25474.3.diff fixes the duplicate comment format and cleans up a bunch of the language for clarity and consistency.
The action
wp_update_nav_menu
is actually a duplicate hook.