Make WordPress Core


Ignore:
Timestamp:
10/20/2020 03:29:42 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Media: Introduce a filter for wp_get_attachment_image() HTML output.

Props prionkor, antpb, donmhico, audrasjb, Mista-Flo, hellofromTonya.
Fixes #50801.

File:
1 edited

Legend:

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

    r49223 r49234  
    993993
    994994/**
    995  * Get an HTML img element representing an image attachment
     995 * Get an HTML img element representing an image attachment.
    996996 *
    997997 * While `$size` will accept an array, it is better to register a size with
     
    11001100    }
    11011101
    1102     return $html;
     1102    /**
     1103     * HTML img element representing an image attachment.
     1104     *
     1105     * @since 5.6.0
     1106     *
     1107     * @param string       $html          HTML img element or empty string on failure.
     1108     * @param int          $attachment_id Image attachment ID.
     1109     * @param string|int[] $size          Requested image size. Can be any registered image size name, or
     1110     *                                    an array of width and height values in pixels (in that order).
     1111     * @param bool         $icon          Whether the image should be treated as an icon.
     1112     * @param array        $attr          Array of attribute values for the image markup, keyed by attribute name.
     1113     *                                    See wp_get_attachment_image().
     1114     */
     1115    return apply_filters( 'wp_get_attachment_image', $html, $attachment_id, $size, $icon, $attr );
    11031116}
    11041117
Note: See TracChangeset for help on using the changeset viewer.