Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Update parameter type hints to include null for thumbnail-relat… #8029

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/wp-includes/post-thumbnail-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @since 2.9.0
* @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.
*/
function has_post_thumbnail( $post = null ) {
Expand All @@ -46,7 +46,7 @@
* @since 5.5.0 The return value for a non-existing post
* 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),
* or false if the post does not exist.
*/
Expand Down Expand Up @@ -99,7 +99,7 @@
*
* @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 ) {
if ( ! $wp_query ) {
Expand Down Expand Up @@ -156,10 +156,10 @@
* @since 2.9.0
* @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 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'.
* @param string|array $attr Optional. Query string or array of attributes. Default empty.
* @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

Check failure on line 160 in src/wp-includes/post-thumbnail-template.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Spaces must be used for mid-line alignment; tabs are not allowed
JasonSa19 marked this conversation as resolved.
Show resolved Hide resolved
* 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.

Check failure on line 162 in src/wp-includes/post-thumbnail-template.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Spaces must be used for mid-line alignment; tabs are not allowed
* @return string The post thumbnail image tag.
*/
function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr = '' ) {
Expand Down Expand Up @@ -241,9 +241,9 @@
*
* @since 4.4.0
*
* @param int|WP_Post $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
* of height and width dimensions. Default 'post-thumbnail'.
* @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

Check failure on line 245 in src/wp-includes/post-thumbnail-template.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Spaces must be used for mid-line alignment; tabs are not allowed
JasonSa19 marked this conversation as resolved.
Show resolved Hide resolved
* 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
* any registered image size, the original image URL will be returned.
*/
Expand Down Expand Up @@ -291,7 +291,7 @@
*
* @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.
*/
function get_the_post_thumbnail_caption( $post = null ) {
Expand All @@ -315,7 +315,7 @@
*
* @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 ) {
/**
Expand Down
Loading