wp_get_original_image_url
Filters the URL to the original attachment image.
Usage
add_filter( 'wp_get_original_image_url', 'wp_kama_get_original_image_url_filter', 10, 2 ); /** * Function for `wp_get_original_image_url` filter-hook. * * @param string $original_image_url URL to original image. * @param int $attachment_id Attachment ID. * * @return string */ function wp_kama_get_original_image_url_filter( $original_image_url, $attachment_id ){ // filter... return $original_image_url; }
- $original_image_url(string)
- URL to original image.
- $attachment_id(int)
- Attachment ID.
Changelog
Since 5.3.0 | Introduced. |
Where the hook is called
wp_get_original_image_url
wp-includes/post.php 8183
return apply_filters( 'wp_get_original_image_url', $original_image_url, $attachment_id );