[wp-trac] [WordPress Trac] #64251: Documentation for `add_meta_boxes hook` is incorrect

WordPress Trac noreply at wordpress.org
Thu Nov 13 17:43:00 UTC 2025


#64251: Documentation for `add_meta_boxes hook` is incorrect
--------------------------------+-----------------------------
 Reporter:  opr18               |      Owner:  (none)
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:
 Severity:  normal              |   Keywords:
  Focuses:                      |
--------------------------------+-----------------------------
 Related ticket: https://core.trac.wordpress.org/ticket/43229 that seems
 was solved a while ago, but has since changed back.

 [The documentation for this
 hook](https://core.trac.wordpress.org/browser/tags/6.8.3/src/wp-
 admin/includes/meta-boxes.php#L1714) states that $post will be a WP_Post
 however in these locations it is not

 - https://core.trac.wordpress.org/browser/tags/6.8.3/src/wp-admin/edit-
 link-form.php#L37
 - https://core.trac.wordpress.org/browser/tags/6.8.3/src/wp-admin/edit-
 form-comment.php#L257
 - https://core.trac.wordpress.org/browser/tags/6.8.3/src/wp-admin/includes
 /meta-boxes.php#L1683

 I think some possible resolutions here would be:

 - Update the docs to loosen the type of the second param being passed to
 the hook
 - Fix instances where the second param to the hook is not a `WP_Post`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64251>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list