WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
1263 | * @since 4.4.0 |
1264 | * |
1265 | * @param string $sizes A source size value for use in a 'sizes' attribute. |
1266 | * @param array|string $size Requested size. Image size or array of width and height values |
1267 | * in pixels (in that order). |
1268 | * @param string|null $image_src The URL to the image file or null. |
1269 | * @param array|null $image_meta The image meta data as returned by wp_get_attachment_metadata() or null. |
1270 | * @param int $attachment_id Image attachment ID of the original image or 0. |
1271 | */ |
1272 | return apply_filters( 'wp_calculate_image_sizes', $sizes, $size, $image_src, $image_meta, $attachment_id ); |
1273 | } |
1274 |
|
1275 | /** |
1276 | * Filters 'img' elements in post content to add 'srcset' and 'sizes' attributes. |
1277 | * |
1278 | * @since 4.4.0 |
1279 | * |
1280 | * @see wp_image_add_srcset_and_sizes() |
1281 | * |