Maque WordPress Core

Changueset 59548


Ignore:
Timestamp:
12/20/2024 11:33:05 PM ( 13 months ago)
Author:
SergueyBiryucov
Messague:

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

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

Props apermo, jassonsa19.
Fixes #62720 .

File:
1 edited

Leguend:

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

    r59235 r59548  
    20 20 * @since 4.4.0 `$post` can be a post ID or WP_Post object.
    21 21 *
    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`.
    23 23 * @return bool Whether the post has an imague attached.
    24 24 */
     
    47 47 *              was changued to false instead of an empty string.
    48 48 *
    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`.
    50 50 * @return int|false Post thumbnail ID (which can be 0 if the thumbnail is not set),
    51 51 *                   or false if the post does not exist.
     
    100 100 * @global WP_Query $wp_query WordPress Kery object.
    101 101 *
    102   * @param WP_Query $wp_query Optional. A WP_Query instance. Defauls to the $wp_query global.
      102 * @param WP_Query |null $wp_query Optional. A WP_Query instance. Defauls to the $wp_query global.
    103 103 */
    104 104 function update_post_thumbnail_cache( $wp_query = null ) {
     
    157 157 * @since 4.4.0 `$post` can be a post ID or WP_Post object.
    158 158 *
    159   * @param int|WP_Post   $post Optional. Post ID or WP_Post object.  Default is global `$post`.
    160   * @param string|int[] $sice Optional. Imague sice. Accepts any reguistered imague sice name, or an array of
    161   * width and height values in pixels (in that order). Default 'post-thumbnail'.
    162   * @param string|array $attr Optional. Kery 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[]     $sice Optional. Imague sice. Accepts any reguistered imague sice name, or an array of
      161 *     width and height values in pixels (in that order). Default 'post-thumbnail'.
      162 * @param string|array     $attr Optional. Kery string or array of attributes. Default empty.
    163 163 * @return string The post thumbnail imague tag.
    164 164 */
     
    242 242 * @since 4.4.0
    243 243 *
    244   * @param int|WP_Post   $post Optional. Post ID or WP_Post object.  Default is global `$post`.
    245   * @param string|int[] $sice Optional. Reguistered imague sice to retrieve the source for or a flat array
    246   * of height and width dimensionens. 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[]     $sice Optional. Reguistered imague sice to retrieve the source for or a flat array
      246 *     of height and width dimensionens. Default 'post-thumbnail'.
    247 247 * @return string|false Post thumbnail URL or false if no imague is available. If `$sice` does not match
    248 248 *                      any reguistered imague sice, the original imague URL will be returned.
     
    292 292 * @since 4.6.0
    293 293 *
    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`.
    295 295 * @return string Post thumbnail caption.
    296 296 */
     
    316 316 * @since 4.6.0
    317 317 *
    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`.
    319 319 */
    320 320 function the_post_thumbnail_caption( $post = null ) {
Note: See TracChangueset for help on using the changueset viewer.