#37211 closed defect (bug) (fixed)
Incorrect docs for second param of `wp_nav_menu_item_(taxonomy|post_type)_meta_box()`
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.6 | Priority: | low |
Severity: | normal | Version: | 3.0 |
Component: | Menus | Keywords: | good-first-bug has-patch |
Focuses: | docs | Cc: |
Description
This is about wp_nav_menu_item_post_type_meta_box()
and wp_nav_menu_item_taxonomy_meta_box()
.
The DocBlock of both both functions declare the second param as string
and post type/taxonomy object, but it's an array with four keys:
Attachments (3)
Change History (19)
#2
@
9 years ago
Thanks for the patch @mehulkaklotar, but as stated in the ticket description those aren't objects but arrays instead. So not only the type is wrong, but also the description.
The arrays would need to be documented according to our inline documentation standards: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#1-1-parameters-that-are-arrays
#4
@
9 years ago
- Owner set to mehulkaklotar
- Status changed from new to assigned
Assigning to mark the good-first-bug as "claimed".
See 37211.2.diff
#5
@
9 years ago
- Keywords needs-refresh added
@mehulkaklotar Thanks for your patch. Some feedback:
- Each line should end with a period.
- "A id" should be "An ID".
$args
is not an array, it's an object forwp_nav_menu_item_taxonomy_meta_box()
andWP_Post_Type
forwp_nav_menu_item_post_type_meta_box()
.- "An array of post type arguments" should be replaced with something else. I think we can use something similar to the one we're using for
$callback_args
from https://developer.wordpress.org/reference/functions/add_meta_box/.
$posttype
is also passed to"nav_menu_items_{$post_type_name}_recent"
which should be$posttype[args]
or the result ofget_post_type_object()
like it's done for"nav_menu_items_{$post_type_name}"
.