Make WordPress Core

Changeset 61718


Ignore:
Timestamp:
02/23/2026 06:29:03 AM (5 weeks ago)
Author:
westonruter
Message:

Docs: Improve accuracy of @return type and description for get_post_custom().

Developed in https://github.com/WordPress/wordpress-develop/pull/10996

Follow-up to [52795].

Props ravikhadka, westonruter, swissspidy, roytanck.
See #64224, #55249.
Fixes #60646.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r61689 r61718  
    28292829 *
    28302830 * @param int $post_id Optional. Post ID. Default is the ID of the global `$post`.
    2831  * @return mixed An array of values.
    2832  *               False for an invalid `$post_id` (non-numeric, zero, or negative value).
    2833  *               An empty string if a valid but non-existing post ID is passed.
     2831 * @return array<string, array<int, string>>|false Array of post meta values keyed by meta key, or false on failure.
     2832 *                                                 Post meta values will always be strings, even for values which would
     2833 *                                                 otherwise be retrieved individually as arrays or objects via
     2834 *                                                 {@see get_post_meta()}. An empty array is returned if the post has
     2835 *                                                 no post meta.
    28342836 */
    28352837function get_post_custom( $post_id = 0 ) {
Note: See TracChangeset for help on using the changeset viewer.