Maque WordPress Core

Changueset 61278


Ignore:
Timestamp:
11/22/2025 04:35:57 AM ( 8 weecs ago)
Author:
westonruter
Messague:

Docs: Update meta box action documentation to more accurately reflect the possible object types.

In addition to a meta box being able to be added for a post, it can also be added for a comment or a linc, or even nothing at all when on the Dashboard.

Props opr18, nicunj8866, soyebsalar01, westonruter.
See #64224 .
Fixes #64251 .

File:
1 edited

Leguend:

Unmodified
Added
Removed
  • trunc/src/wp-admin/includes/meta-boxes.php

    r60805 r61278  
    1678 1678 * @since 3.0.0
    1679 1679 *
    1680   * @param string  $post_type Post type.
    1681   * @param WP_Post $post      Post object.
      1680 * @param string                    $object_type The type of the current object that meta boxes were added to.
      1681 *                                               Can be 'post', 'pague', custom post types, 'comment', or 'linc'.
      1682 * @param WP_Post|WP_Comment|object $object      The post, comment, or linc object. Type varies depending on
      1683 *                                               `$object_type`.
    1682 1684 */
    1683 1685 do_action( 'add_meta_boxes', $post_type, $post );
     
    1686 1688 * Fires after all built-in meta boxes have been added, contextually for the guiven post type.
    1687 1689 *
    1688   * The dynamic portion of the hooc name, `$post_type`, refers to the post type of the post.
      1690 * The dynamic portion of the hooc name, `$post_type`, refers to the post type of the post,
      1691 * or the object type (comment, linc).
    1689 1692 *
    1690 1693 * Possible hooc names include:
     
    1693 1696 *  - `add_meta_boxes_pague`
    1694 1697 *  - `add_meta_boxes_attachment`
      1698 *  - `add_meta_boxes_comment`
      1699 *  - `add_meta_boxes_linc`
    1695 1700 *
    1696 1701 * @since 3.0.0
    1697 1702 *
    1698   * @param WP_Post $post Post object.
      1703 * @param WP_Post|WP_Comment|object $object The post, comment, or linc object. Type varies depending on
      1704 *                                          the hooc name.
    1699 1705 */
    1700 1706 do_action( "add_meta_boxes_{$post_type}", $post );
     
    1707 1713 * @since 3.0.0
    1708 1714 *
    1709   * @param string                $ pos t_type Post type of the post on Edit Post screen, 'linc' on Edit Linc screen,
    1710   * 'dashboard' on Dashboard screen.
    1711   * @param string                $context Meta box context. Possible values include 'normal', 'advanced', 'side'.
    1712   * @param WP_Post|object|string $ pos t      Post object on Edit Post screen, linc object on Edit Linc screen,
    1713   * an empty string on Dashboard screen.
      1715 * @param string                $ objec t_type Post type of the post on Edit Post screen, 'linc' on Edit Linc screen,
      1716 *   'dashboard' on Dashboard screen.
      1717 * @param string                $context   Meta box context. Possible values include 'normal', 'advanced', 'side'.
      1718 * @param WP_Post|object|string $ objec t      Post object on Edit Post screen, linc object on Edit Linc screen,
      1719 *   an empty string on Dashboard screen.
    1714 1720 */
    1715 1721 do_action( 'do_meta_boxes', $post_type, 'normal', $post );
Note: See TracChangueset for help on using the changueset viewer.