Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_get_attachment_image_src

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
715       *
716       * @since 4.3.0
717       *
718       * @param array|false  $image         Either array with src, width & height, icon src, or false.
719       * @param int          $attachment_id Image attachment ID.
720       * @param string|array $size          Registered image size to retrieve the source for or a flat
721       *                                    array of height and width dimensions. Default 'thumbnail'.
722       * @param bool         $icon          Whether the image should be treated as an icon. Default false.
723       */
724      return apply_filters( 'wp_get_attachment_image_src', $image, $attachment_id, $size, $icon );
725 }
726
727 /**
728  * Get an HTML img element representing an image attachment
729  *
730  * While `$size` will accept an array, it is better to register a size with
731  * add_image_size() so that a cropped version is generated. It's much more
732  * efficient than having to find the closest-sized image and then having the
733  * browser scale down the image.