Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/wp-includes/category-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ function the_terms( $post_id, $taxonomy, $before = '', $sep = ', ', $after = ''
*
* @param string|int|array $category Optional. The category name/term_id/slug,
* or an array of them to check for. Default empty.
* @param int|WP_Post $post Optional. Post to check. Defaults to the current post.
* @param int|WP_Post|null $post Optional. Post to check. Defaults to the current post.
* @return bool True if the current post has any of the given categories
* (or any category, if no category specified). False otherwise.
*/
Expand All @@ -1514,7 +1514,7 @@ function has_category( $category = '', $post = null ) {
*
* @param string|int|array $tag Optional. The tag name/term_id/slug,
* or an array of them to check for. Default empty.
* @param int|WP_Post $post Optional. Post to check. Defaults to the current post.
* @param int|WP_Post|null $post Optional. Post to check. Defaults to the current post.
* @return bool True if the current post has any of the given tags
* (or any tag, if no tag specified). False otherwise.
*/
Expand All @@ -1535,7 +1535,7 @@ function has_tag( $tag = '', $post = null ) {
* @param string|int|array $term Optional. The term name/term_id/slug,
* or an array of them to check for. Default empty.
* @param string $taxonomy Optional. Taxonomy name. Default empty.
* @param int|WP_Post $post Optional. Post to check. Defaults to the current post.
* @param int|WP_Post|null $post Optional. Post to check. Defaults to the current post.
* @return bool True if the current post has any of the given terms
* (or any term, if no term specified). False otherwise.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/comment-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -2157,8 +2157,8 @@ function comment_form_title( $no_reply_text = false, $reply_text = false, $link_
*
* @access private
*
* @param int|WP_Post $post The post the comment is being displayed for.
* Defaults to the current global post.
* @param int|WP_Post|null $post The post the comment is being displayed for.
* Defaults to the current global post.
* @return int Comment's reply to ID.
*/
function _get_comment_reply_id( $post = null ) {
Expand Down
8 changes: 4 additions & 4 deletions src/wp-includes/embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ function wp_maybe_enqueue_oembed_host_js( $html ) {
*
* @since 4.4.0
*
* @param int|WP_Post $post Optional. Post ID or object. Defaults to the current post.
* @param int|WP_Post|null $post Optional. Post ID or object. Defaults to the current post.
* @return string|false The post embed URL on success, false if the post doesn't exist.
*/
function get_post_embed_url( $post = null ) {
Expand Down Expand Up @@ -482,9 +482,9 @@ function get_oembed_endpoint_url( $permalink = '', $format = 'json' ) {
*
* @since 4.4.0
*
* @param int $width The width for the response.
* @param int $height The height for the response.
* @param int|WP_Post $post Optional. Post ID or object. Default is global `$post`.
* @param int $width The width for the response.
* @param int $height The height for the response.
* @param int|WP_Post|null $post Optional. Post ID or object. Default is global `$post`.
* @return string|false Embed code on success, false if post doesn't exist.
*/
function get_post_embed_html( $width, $height, $post = null ) {
Expand Down
58 changes: 29 additions & 29 deletions src/wp-includes/general-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -2716,8 +2716,8 @@ function the_date( $format = '', $before = '', $after = '', $display = true ) {
*
* @since 3.0.0
*
* @param string $format Optional. PHP date format. Defaults to the 'date_format' option.
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post.
* @param string $format Optional. PHP date format. Defaults to the 'date_format' option.
* @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default current post.
* @return string|int|false Date the current post was written. False on failure.
*/
function get_the_date( $format = '', $post = null ) {
Expand Down Expand Up @@ -2782,8 +2782,8 @@ function the_modified_date( $format = '', $before = '', $after = '', $display =
* @since 2.1.0
* @since 4.6.0 Added the `$post` parameter.
*
* @param string $format Optional. PHP date format. Defaults to the 'date_format' option.
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post.
* @param string $format Optional. PHP date format. Defaults to the 'date_format' option.
* @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default current post.
* @return string|int|false Date the current post was modified. False on failure.
*/
function get_the_modified_date( $format = '', $post = null ) {
Expand Down Expand Up @@ -2838,10 +2838,10 @@ function the_time( $format = '' ) {
*
* @since 1.5.0
*
* @param string $format Optional. Format to use for retrieving the time the post
* was written. Accepts 'G', 'U', or PHP date format.
* Defaults to the 'time_format' option.
* @param int|WP_Post $post Post ID or post object. Default is global `$post` object.
* @param string $format Optional. Format to use for retrieving the time the post
* was written. Accepts 'G', 'U', or PHP date format.
* Defaults to the 'time_format' option.
* @param int|WP_Post|null $post Post ID or post object. Default is global `$post` object.
* @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
* False on failure.
*/
Expand Down Expand Up @@ -2874,10 +2874,10 @@ function get_the_time( $format = '', $post = null ) {
*
* @since 2.0.0
*
* @param string $format Optional. Format to use for retrieving the time the post
* was written. Accepts 'G', 'U', or PHP date format. Default 'U'.
* @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
* @param int|WP_Post $post Post ID or post object. Default is global `$post` object.
* @param string $format Optional. Format to use for retrieving the time the post
* was written. Accepts 'G', 'U', or PHP date format. Default 'U'.
* @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
* @param int|WP_Post|null $post Post ID or post object. Default is global `$post` object.
* @param bool $translate Whether to translate the time string. Default false.
* @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
* False on failure.
Expand Down Expand Up @@ -2938,11 +2938,11 @@ function get_post_time( $format = 'U', $gmt = false, $post = null, $translate =
*
* @since 5.3.0
*
* @param int|WP_Post $post Optional. Post ID or post object. Default is global `$post` object.
* @param string $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
* Default 'date'.
* @param string $source Optional. Local or UTC time to use from database. Accepts 'local' or 'gmt'.
* Default 'local'.
* @param int|WP_Post|null $post Optional. Post ID or post object. Default is global `$post` object.
* @param string $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
* Default 'date'.
* @param string $source Optional. Local or UTC time to use from database. Accepts 'local' or 'gmt'.
* Default 'local'.
* @return DateTimeImmutable|false Time object on success, false on failure.
*/
function get_post_datetime( $post = null, $field = 'date', $source = 'local' ) {
Expand Down Expand Up @@ -2983,9 +2983,9 @@ function get_post_datetime( $post = null, $field = 'date', $source = 'local' ) {
*
* @since 5.3.0
*
* @param int|WP_Post $post Optional. Post ID or post object. Default is global `$post` object.
* @param string $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
* Default 'date'.
* @param int|WP_Post|null $post Optional. Post ID or post object. Default is global `$post` object.
* @param string $field Optional. Published or modified time to use from database. Accepts 'date' or 'modified'.
* Default 'date'.
* @return int|false Unix timestamp on success, false on failure.
*/
function get_post_timestamp( $post = null, $field = 'date' ) {
Expand Down Expand Up @@ -3026,10 +3026,10 @@ function the_modified_time( $format = '' ) {
* @since 2.0.0
* @since 4.6.0 Added the `$post` parameter.
*
* @param string $format Optional. Format to use for retrieving the time the post
* was modified. Accepts 'G', 'U', or PHP date format.
* Defaults to the 'time_format' option.
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default current post.
* @param string $format Optional. Format to use for retrieving the time the post
* was modified. Accepts 'G', 'U', or PHP date format.
* Defaults to the 'time_format' option.
* @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default current post.
* @return string|int|false Formatted date string or Unix timestamp. False on failure.
*/
function get_the_modified_time( $format = '', $post = null ) {
Expand Down Expand Up @@ -3063,11 +3063,11 @@ function get_the_modified_time( $format = '', $post = null ) {
*
* @since 2.0.0
*
* @param string $format Optional. Format to use for retrieving the time the post
* was modified. Accepts 'G', 'U', or PHP date format. Default 'U'.
* @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
* @param int|WP_Post $post Post ID or post object. Default is global `$post` object.
* @param bool $translate Whether to translate the time string. Default false.
* @param string $format Optional. Format to use for retrieving the time the post
* was modified. Accepts 'G', 'U', or PHP date format. Default 'U'.
* @param bool $gmt Optional. Whether to retrieve the GMT time. Default false.
* @param int|WP_Post|null $post Post ID or post object. Default is global `$post` object.
* @param bool $translate Whether to translate the time string. Default false.
* @return string|int|false Formatted date string or Unix timestamp if `$format` is 'U' or 'G'.
* False on failure.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/link-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function permalink_anchor( $mode = 'id' ) {
*
* @since 5.7.0
*
* @param WP_Post|int|null $post Optional. Post ID or post object. Defaults to global $post.
* @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post.
* @param bool|null $sample Optional. Whether to force consideration based on sample links.
* If omitted, a sample link is generated if a post object is passed
* with the filter property set to 'sample'.
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/ms-blogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ function _update_posts_count_on_delete( $post_id, $post ) {
*
* @param string $new_status The status the post is changing to.
* @param string $old_status The status the post is changing from.
* @param WP_Post $post Post object
* @param WP_Post|null $post Post object.
*/
function _update_posts_count_on_transition_post_status( $new_status, $old_status, $post = null ) {
if ( $new_status === $old_status ) {
Expand Down
8 changes: 4 additions & 4 deletions src/wp-includes/post-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function the_excerpt() {
* @since 0.71
* @since 4.5.0 Introduced the `$post` parameter.
*
* @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 excerpt.
*/
function get_the_excerpt( $post = null ) {
Expand Down Expand Up @@ -460,7 +460,7 @@ function has_excerpt( $post = 0 ) {
*
* @param string|string[] $css_class Optional. One or more classes to add to the class list.
* Default empty.
* @param int|WP_Post $post Optional. Post ID or post object. Defaults to the global `$post`.
* @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to the global `$post`.
*/
function post_class( $css_class = '', $post = null ) {
// Separates classes with a single space, collates classes for post DIV.
Expand Down Expand Up @@ -488,7 +488,7 @@ function post_class( $css_class = '', $post = null ) {
*
* @param string|string[] $css_class Optional. Space-separated string or array of class names
* to add to the class list. Default empty.
* @param int|WP_Post $post Optional. Post ID or post object.
* @param int|WP_Post|null $post Optional. Post ID or post object.
* @return string[] Array of class names.
*/
function get_post_class( $css_class = '', $post = null ) {
Expand Down Expand Up @@ -1883,7 +1883,7 @@ function is_page_template( $template = '' ) {
* @since 3.4.0
* @since 4.7.0 Now works with any post type, not just pages.
*
* @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|false Page template filename. Returns an empty string when the default page template
* is in use. Returns false if the post does not exist.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ function get_post_field( $field, $post = null, $context = 'display' ) {
*
* @since 2.0.0
*
* @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post.
* @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post.
* @return string|false The mime type on success, false on failure.
*/
function get_post_mime_type( $post = null ) {
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/widgets/class-wp-widget-media.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ class="media-widget-instance-property"
*
* @since 4.8.0
*
* @param array $states An array of media states.
* @param WP_Post $post The current attachment object.
* @param array $states An array of media states.
* @param WP_Post|null $post The current attachment object.
* @return array
*/
public function display_media_state( $states, $post = null ) {
Expand Down
Loading