WordPress.org

Make WordPress Core

Ticket #50835: 50835.4.diff

File 50835.4.diff, 4.1 KB (added by johnbillion, 5 weeks ago)
  • src/wp-includes/media.php

     
    37673767 * @since 3.5.0
    37683768 *
    37693769 * @param int|WP_Post $attachment Attachment ID or object.
    3770  * @return array|void Array of attachment details.
     3770 *
     3771 * @return array|void {
     3772 *     Array of attachment details, or void if the parameter does not correspond to an attachment.
     3773 *
     3774 *     @type string $alt                   Alt text of the attachment.
     3775 *     @type string $author                ID of the attachment author, as a string.
     3776 *     @type string $authorName            Name of the attachment author.
     3777 *     @type string $caption               Caption for the attachment.
     3778 *     @type array  $compat                Containing item and meta.
     3779 *     @type string $context               Context, whether it's used as the site icon for example.
     3780 *     @type int    $date                  Uploaded date, timestamp in milliseconds.
     3781 *     @type string $dateFormatted         Formatted date (eg. June 29, 2018).
     3782 *     @type string $description           Description of the attachment.
     3783 *     @type string $editLink              URL to the edit page for the attachment.
     3784 *     @type string $filename              File name of the attachment.
     3785 *     @type string $filesizeHumanReadable Filesize of the attachment in human readable format (eg. 1 MB).
     3786 *     @type int    $filesizeInBytes       Filesize of the attachment in bytes.
     3787 *     @type int    $height                If the attachment is an image, represents the height of the image in pixels.
     3788 *     @type string $icon                  Icon URL of the attachment (eg. /wp-includes/images/media/archive.png).
     3789 *     @type int    $id                    ID of the attachment.
     3790 *     @type string $link                  URL to the attachment.
     3791 *     @type int    $menuOrder             Menu order of the attachment post.
     3792 *     @type array  $meta                  Meta data for the attachment.
     3793 *     @type string $mime                  Mime type of the attachment (eg. image/jpeg or application/zip).
     3794 *     @type int    $modified              Last modified, timestamp in milliseconds.
     3795 *     @type string $name                  Name, same as title of the attachment.
     3796 *     @type array  $nonces                Nonces for update, delete and edit.
     3797 *     @type string $orientation           If the attachment is an image, represents the image orientation (landscape or portrait).
     3798 *     @type array  $sizes                 If the attachment is an image, contains an array of arrays for the images sizes: thumbnail, medium, large, and full.
     3799 *     @type string $status                Post status of the attachmnet (usually 'inherit').
     3800 *     @type string $subtype               Mime subtype of the attachment (usually the last part, eg. jpeg or zip).
     3801 *     @type string $title                 Title of the attachment (usually the slugified file name without the extension).
     3802 *     @type string $type                  Type of the attachment (usually first part of the mime type, eg. image).
     3803 *     @type int    $uploadedTo            Parent post to which the attachment was uploaded.
     3804 *     @type string $uploadedToLink        URL to the edit page of the parent post of the attachment.
     3805 *     @type string $uploadedToTitle       Post title of the parent of the attachment.
     3806 *     @type string $url                   Direct URL to the attachment file (from wp-content).
     3807 *     @type int    $width                 If the attachment is an image, represents the width of the image in pixels.
     3808 * }
     3809 *
    37713810 */
    37723811function wp_prepare_attachment_for_js( $attachment ) {
    37733812        $attachment = get_post( $attachment );
     
    39994038         *
    40004039         * @since 3.5.0
    40014040         *
    4002          * @param array       $response   Array of prepared attachment data.
     4041         * @param array       $response   Array of prepared attachment data. @see wp_prepare_attachment_for_js().
    40034042         * @param WP_Post     $attachment Attachment object.
    40044043         * @param array|false $meta       Array of attachment meta data, or false if there is none.
    40054044         */