Make WordPress Core

Changeset 59548


Ignore:
Timestamp:
12/20/2024 11:33:05 PM (7 months ago)
Author:
SergeyBiryukov
Message:

Docs: Update parameter type hints to include null for post thumbnail functions.

Follow-up to [12320], [12351], [20646], [32618], [34167], [34373], [37915].

Props apermo, jasonsa19.
Fixes #62720.

File:
1 edited

Legend:

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

    r59235 r59548  
    2020 * @since 4.4.0 `$post` can be a post ID or WP_Post object.
    2121 *
    22  * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
     22 * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global `$post`.
    2323 * @return bool Whether the post has an image attached.
    2424 */
     
    4747 *              was changed to false instead of an empty string.
    4848 *
    49  * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
     49 * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global `$post`.
    5050 * @return int|false Post thumbnail ID (which can be 0 if the thumbnail is not set),
    5151 *                   or false if the post does not exist.
     
    100100 * @global WP_Query $wp_query WordPress Query object.
    101101 *
    102  * @param WP_Query $wp_query Optional. A WP_Query instance. Defaults to the $wp_query global.
     102 * @param WP_Query|null $wp_query Optional. A WP_Query instance. Defaults to the $wp_query global.
    103103 */
    104104function update_post_thumbnail_cache( $wp_query = null ) {
     
    157157 * @since 4.4.0 `$post` can be a post ID or WP_Post object.
    158158 *
    159  * @param int|WP_Post  $post Optional. Post ID or WP_Post object.  Default is global `$post`.
    160  * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of
    161  *                           width and height values in pixels (in that order). Default 'post-thumbnail'.
    162  * @param string|array $attr Optional. Query string or array of attributes. Default empty.
     159 * @param int|WP_Post|null $post Optional. Post ID or WP_Post object.  Default is global `$post`.
     160 * @param string|int[]     $size Optional. Image size. Accepts any registered image size name, or an array of
     161 *                               width and height values in pixels (in that order). Default 'post-thumbnail'.
     162 * @param string|array     $attr Optional. Query string or array of attributes. Default empty.
    163163 * @return string The post thumbnail image tag.
    164164 */
     
    242242 * @since 4.4.0
    243243 *
    244  * @param int|WP_Post  $post Optional. Post ID or WP_Post object.  Default is global `$post`.
    245  * @param string|int[] $size Optional. Registered image size to retrieve the source for or a flat array
    246  *                           of height and width dimensions. Default 'post-thumbnail'.
     244 * @param int|WP_Post|null $post Optional. Post ID or WP_Post object.  Default is global `$post`.
     245 * @param string|int[]     $size Optional. Registered image size to retrieve the source for or a flat array
     246 *                               of height and width dimensions. Default 'post-thumbnail'.
    247247 * @return string|false Post thumbnail URL or false if no image is available. If `$size` does not match
    248248 *                      any registered image size, the original image URL will be returned.
     
    292292 * @since 4.6.0
    293293 *
    294  * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
     294 * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global `$post`.
    295295 * @return string Post thumbnail caption.
    296296 */
     
    316316 * @since 4.6.0
    317317 *
    318  * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`.
     318 * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global `$post`.
    319319 */
    320320function the_post_thumbnail_caption( $post = null ) {
Note: See TracChangeset for help on using the changeset viewer.