wp_get_original_image_url
Filter HookDescription
Filters the URL to the original attachment image.Hook Information
File Location |
wp-includes/post.php
View on GitHub
|
Hook Type | Filter |
Line Number | 8412 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$original_image_url
|
URL to original image. |
int
|
$attachment_id
|
Attachment ID. |
Usage Examples
Basic Usage
<?php
// Hook into wp_get_original_image_url
add_filter('wp_get_original_image_url', 'my_custom_filter', 10, 2);
function my_custom_filter($original_image_url, $attachment_id) {
// Your custom filtering logic here
return $original_image_url;
}
Source Code Context
wp-includes/post.php:8412
- How this hook is used in WordPress core
<?php
8407 * @since 5.3.0
8408 *
8409 * @param string $original_image_url URL to original image.
8410 * @param int $attachment_id Attachment ID.
8411 */
8412 return apply_filters( 'wp_get_original_image_url', $original_image_url, $attachment_id );
8413 }
8414
8415 /**
8416 * Filters callback which sets the status of an untrashed post to its previous status.
8417 *
PHP Documentation
<?php
/**
* Filters the URL to the original attachment image.
*
* @since 5.3.0
*
* @param string $original_image_url URL to original image.
* @param int $attachment_id Attachment ID.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/post.php
Related Hooks
Related hooks will be displayed here in future updates.