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.
Built from https://develop.svn.wordpress.org/trunk@59548


git-svn-id: http://core.svn.wordpress.org/trunk@58934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-12-20 23:35:23 +00:00
parent 1747403b13
commit 48eb68ca1e
2 changed files with 13 additions and 13 deletions

View File

@ -19,7 +19,7 @@
* @since 2.9.0 * @since 2.9.0
* @since 4.4.0 `$post` can be a post ID or WP_Post object. * @since 4.4.0 `$post` can be a post ID or WP_Post object.
* *
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global `$post`.
* @return bool Whether the post has an image attached. * @return bool Whether the post has an image attached.
*/ */
function has_post_thumbnail( $post = null ) { function has_post_thumbnail( $post = null ) {
@ -46,7 +46,7 @@ function has_post_thumbnail( $post = null ) {
* @since 5.5.0 The return value for a non-existing post * @since 5.5.0 The return value for a non-existing post
* was changed to false instead of an empty string. * was changed to false instead of an empty string.
* *
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global `$post`.
* @return int|false Post thumbnail ID (which can be 0 if the thumbnail is not set), * @return int|false Post thumbnail ID (which can be 0 if the thumbnail is not set),
* or false if the post does not exist. * or false if the post does not exist.
*/ */
@ -99,7 +99,7 @@ function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {
* *
* @global WP_Query $wp_query WordPress Query object. * @global WP_Query $wp_query WordPress Query object.
* *
* @param WP_Query $wp_query Optional. A WP_Query instance. Defaults to the $wp_query global. * @param WP_Query|null $wp_query Optional. A WP_Query instance. Defaults to the $wp_query global.
*/ */
function update_post_thumbnail_cache( $wp_query = null ) { function update_post_thumbnail_cache( $wp_query = null ) {
if ( ! $wp_query ) { if ( ! $wp_query ) {
@ -156,10 +156,10 @@ function update_post_thumbnail_cache( $wp_query = null ) {
* @since 2.9.0 * @since 2.9.0
* @since 4.4.0 `$post` can be a post ID or WP_Post object. * @since 4.4.0 `$post` can be a post ID or WP_Post object.
* *
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global `$post`.
* @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of * @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array of
* width and height values in pixels (in that order). Default 'post-thumbnail'. * width and height values in pixels (in that order). Default 'post-thumbnail'.
* @param string|array $attr Optional. Query string or array of attributes. Default empty. * @param string|array $attr Optional. Query string or array of attributes. Default empty.
* @return string The post thumbnail image tag. * @return string The post thumbnail image tag.
*/ */
function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr = '' ) { function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr = '' ) {
@ -241,9 +241,9 @@ function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr =
* *
* @since 4.4.0 * @since 4.4.0
* *
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global `$post`.
* @param string|int[] $size Optional. Registered image size to retrieve the source for or a flat array * @param string|int[] $size Optional. Registered image size to retrieve the source for or a flat array
* of height and width dimensions. Default 'post-thumbnail'. * of height and width dimensions. Default 'post-thumbnail'.
* @return string|false Post thumbnail URL or false if no image is available. If `$size` does not match * @return string|false Post thumbnail URL or false if no image is available. If `$size` does not match
* any registered image size, the original image URL will be returned. * any registered image size, the original image URL will be returned.
*/ */
@ -291,7 +291,7 @@ function the_post_thumbnail_url( $size = 'post-thumbnail' ) {
* *
* @since 4.6.0 * @since 4.6.0
* *
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global `$post`.
* @return string Post thumbnail caption. * @return string Post thumbnail caption.
*/ */
function get_the_post_thumbnail_caption( $post = null ) { function get_the_post_thumbnail_caption( $post = null ) {
@ -315,7 +315,7 @@ function get_the_post_thumbnail_caption( $post = null ) {
* *
* @since 4.6.0 * @since 4.6.0
* *
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global `$post`.
*/ */
function the_post_thumbnail_caption( $post = null ) { function the_post_thumbnail_caption( $post = null ) {
/** /**

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.8-alpha-59545'; $wp_version = '6.8-alpha-59548';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.