Make WordPress Core

Changeset 38068


Ignore:
Timestamp:
07/16/2016 01:04:01 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Docs: Correct $post parameter name and description for wp_attachment_is() and wp_attachment_is_image().

Props flixos90.
Fixes #37377.

File:
1 edited

Legend:

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

    r38051 r38068  
    50435043 * @since 4.2.0
    50445044 *
    5045  * @param string      $type    Attachment type. Accepts 'image', 'audio', or 'video'.
    5046  * @param int|WP_Post $post_id Optional. Attachment ID. Default 0.
     5045 * @param string      $type Attachment type. Accepts 'image', 'audio', or 'video'.
     5046 * @param int|WP_Post $post Optional. Attachment ID or object. Default is global $post.
    50475047 * @return bool True if one of the accepted types, false otherwise.
    50485048 */
    5049 function wp_attachment_is( $type, $post_id = 0 ) {
    5050     if ( ! $post = get_post( $post_id ) ) {
     5049function wp_attachment_is( $type, $post = null ) {
     5050    if ( ! $post = get_post( $post ) ) {
    50515051        return false;
    50525052    }
     
    50945094 *              allowed WP_Post object to be passed.
    50955095 *
    5096  * @param int|WP_Post $post Optional. Attachment ID. Default 0.
     5096 * @param int|WP_Post $post Optional. Attachment ID or object. Default is global $post.
    50975097 * @return bool Whether the attachment is an image.
    50985098 */
    5099 function wp_attachment_is_image( $post = 0 ) {
     5099function wp_attachment_is_image( $post = null ) {
    51005100    return wp_attachment_is( 'image', $post );
    51015101}
Note: See TracChangeset for help on using the changeset viewer.