Make WordPress Core

Changeset 50266


Ignore:
Timestamp:
02/09/2021 01:42:58 PM (4 years ago)
Author:
johnbillion
Message:

Posts, Post Types: Clarify the documentation about the return value of get_post() when a falsey value is passed.

Props Rahe, juliobox, peterwilsoncc, hellofromTonya, audrasjb

Fixes #33068

File:
1 edited

Legend:

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

    r50257 r50266  
    752752 * @global WP_Post $post Global post object.
    753753 *
    754  * @param int|WP_Post|null $post   Optional. Post ID or post object. Defaults to global $post.
     754 * @param int|WP_Post|null $post   Optional. Post ID or post object. `null`, `false`, `0` and other PHP falsey
     755 *                                 values return the current global post inside the loop. A numerically valid post
     756 *                                 ID that points to a non-existent post returns `null`. Defaults to global $post.
    755757 * @param string           $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which
    756758 *                                 correspond to a WP_Post object, an associative array, or a numeric array,
Note: See TracChangeset for help on using the changeset viewer.