Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_get_attachment_image

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1111       *
1112       * @param string       $html          HTML img element or empty string on failure.
1113       * @param int          $attachment_id Image attachment ID.
1114       * @param string|int[] $size          Requested image size. Can be any registered image size name, or
1115       *                                    an array of width and height values in pixels (in that order).
1116       * @param bool         $icon          Whether the image should be treated as an icon.
1117       * @param string[]     $attr          Array of attribute values for the image markup, keyed by attribute name.
1118       *                                    See wp_get_attachment_image().
1119       */
1120      return apply_filters( 'wp_get_attachment_image', $html, $attachment_id, $size, $icon, $attr );
1121 }
1122
1123 /**
1124  * Gets the URL of an image attachment.
1125  *
1126  * @since 4.4.0
1127  *
1128  * @param int          $attachment_id Image attachment ID.
1129  * @param string|int[] $size          Optional. Image size. Accepts any registered image size name, or an array of