Make WordPress Core


Ignore:
Timestamp:
08/22/2017 11:11:23 AM (7 years ago)
Author:
johnbillion
Message:

Media: Rename several attachment related parameters from $post_id to $attachment_id for clarity, and improve related
documentation.

See #41017

File:
1 edited

Legend:

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

    r40922 r41288  
    232232/**
    233233 * Streams image in WP_Image_Editor to browser.
    234  * Provided for backcompat reasons
    235  *
    236  * @param WP_Image_Editor $image
    237  * @param string $mime_type
    238  * @param int $post_id
    239  * @return bool
    240  */
    241 function wp_stream_image( $image, $mime_type, $post_id ) {
     234 *
     235 * @param WP_Image_Editor $image         The image editor instance.
     236 * @param string          $mime_type     The mime type of the image.
     237 * @param int             $attachment_id The image's attachment post ID.
     238 * @return bool True on success, false on failure.
     239 */
     240function wp_stream_image( $image, $mime_type, $attachment_id ) {
    242241    if ( $image instanceof WP_Image_Editor ) {
    243242
     
    247246         * @since 3.5.0
    248247         *
    249          * @param WP_Image_Editor $image   WP_Image_Editor instance.
    250          * @param int             $post_id Post ID.
     248         * @param WP_Image_Editor $image         The image editor instance.
     249         * @param int             $attachment_id The attachment post ID.
    251250         */
    252         $image = apply_filters( 'image_editor_save_pre', $image, $post_id );
     251        $image = apply_filters( 'image_editor_save_pre', $image, $attachment_id );
    253252
    254253        if ( is_wp_error( $image->stream( $mime_type ) ) )
     
    265264         * @deprecated 3.5.0 Use image_editor_save_pre instead.
    266265         *
    267          * @param resource $image   Image resource to be streamed.
    268          * @param int      $post_id Post ID.
     266         * @param resource $image         Image resource to be streamed.
     267         * @param int      $attachment_id The attachment post ID.
    269268         */
    270         $image = apply_filters( 'image_save_pre', $image, $post_id );
     269        $image = apply_filters( 'image_save_pre', $image, $attachment_id );
    271270
    272271        switch ( $mime_type ) {
Note: See TracChangeset for help on using the changeset viewer.