#43229 closed defect (bug) (fixed)
Documentation for add_meta_boxes hook is incorrect
| Reported by: | johnbillion | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.1 |
| Component: | Options, Meta APIs | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | docs |
Description
The documentation for the add_meta_boxes hook states that the $post parameter is a WP_Post object. This is incorrect because the object can be any type. On the comment editing screen for example, this parameter is a WP_Comment object.
Attachments (1)
Change History (10)
#3
@
9 years ago
- Component General → Options, Meta APIs
Sorry @SergeyBiryukov my comment overwrote the changes. I reverted back.
#4
in reply to: ↑ 2
;
follow-up:
↓ 5
@
9 years ago
Replying to danieltj:
The
add_meta_boxeshook doesn't have a parameter for a$post, at least not in function I found. Am I looking at the wrong one? I didn't see anything that referenced posts.
It's about the add_meta_boxes filter, not the add_meta_box() function :) There are 3 instances of the hook:
#5
in reply to: ↑ 4
@
9 years ago
Replying to SergeyBiryukov:
Replying to danieltj:
The
add_meta_boxeshook doesn't have a parameter for a$post, at least not in function I found. Am I looking at the wrong one? I didn't see anything that referenced posts.
It's about the
add_meta_boxesfilter, not theadd_meta_box()function :) There are 3 instances of the hook:
[...]
Ah, thank you for pointing that out. Was very confused when I saw the docs.
I'll take a look.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The
add_meta_boxeshook doesn't have a parameter for a$post, at least not in function I found. Am I looking at the wrong one? I didn't see anything that referenced posts.Reference: https://core.trac.wordpress.org/browser/tags/4.9/src/wp-admin/includes/template.php#L886