wp_get_attachment_thumb_url
Filters the attachment thumbnail URL.
Usage
add_filter( 'wp_get_attachment_thumb_url', 'wp_kama_get_attachment_thumb_url_filter', 10, 2 );
/**
* Function for `wp_get_attachment_thumb_url` filter-hook.
*
* @param string $thumbnail_url URL for the attachment thumbnail.
* @param int $post_id Attachment ID.
*
* @return string
*/
function wp_kama_get_attachment_thumb_url_filter( $thumbnail_url, $post_id ){
// filter...
return $thumbnail_url;
}
- $thumbnail_url(string)
- URL for the attachment thumbnail.
- $post_id(int)
- Attachment ID.
Changelog
| Since 2.1.0 | Introduced. |
Where the hook is called
wp_get_attachment_thumb_url
wp-includes/post.php 7098
return apply_filters( 'wp_get_attachment_thumb_url', $thumbnail_url, $post_id );