WordPress.org

Make WordPress Core

Changeset 32352


Ignore:
Timestamp:
05/05/2015 02:19:47 AM (4 years ago)
Author:
DrewAPicture
Message:

Fix documentation syntax and formatting for the media_sideload_image() DocBlock.

See #32246.

File:
1 edited

Legend:

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

    r32350 r32352  
    823823
    824824/**
    825  * Download an image from the specified URL and attach it to a post.
     825 * Downloads an image from the specified URL and attaches it to a post.
    826826 *
    827827 * @since 2.6.0
    828828 * @since 4.2.0 Introduced the `$return` parameter.
    829829 *
    830  * @param string $file The URL of the image to download
    831  * @param int $post_id The post ID the media is to be associated with
    832  * @param string $desc Optional. Description of the image
    833  * @param string $return Optional. Accepts 'html' (image tag html) or 'src' (URL). Default 'html'.
    834  * @return string|WP_Error Populated HTML img tag on success
     830 * @param string $file    The URL of the image to download.
     831 * @param int    $post_id The post ID the media is to be associated with.
     832 * @param string $desc    Optional. Description of the image.
     833 * @param string $return  Optional. Accepts 'html' (image tag html) or 'src' (URL). Default 'html'.
     834 * @return string|WP_Error Populated HTML img tag on success, WP_Error object otherwise.
    835835 */
    836836function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' ) {
    837837    if ( ! empty( $file ) ) {
     838
    838839        // Set variables for storage, fix file filename for query strings.
    839840        preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches );
     
    861862    }
    862863
    863     // Finally check to make sure the file has been saved, then return the HTML.
     864    // Finally, check to make sure the file has been saved, then return the HTML.
    864865    if ( ! empty( $src ) ) {
    865866        if ( $return === 'src' ) {
Note: See TracChangeset for help on using the changeset viewer.