wp_get_original_image_path
Filter HookDescription
Filters the path to the original image.Hook Information
File Location |
wp-includes/post.php
View on GitHub
|
Hook Type | Filter |
Line Number | 8370 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$original_image
|
Path to original image file. |
int
|
$attachment_id
|
Attachment ID. |
Usage Examples
Basic Usage
<?php
// Hook into wp_get_original_image_path
add_filter('wp_get_original_image_path', 'my_custom_filter', 10, 2);
function my_custom_filter($original_image, $attachment_id) {
// Your custom filtering logic here
return $original_image;
}
Source Code Context
wp-includes/post.php:8370
- How this hook is used in WordPress core
<?php
8365 * @since 5.3.0
8366 *
8367 * @param string $original_image Path to original image file.
8368 * @param int $attachment_id Attachment ID.
8369 */
8370 return apply_filters( 'wp_get_original_image_path', $original_image, $attachment_id );
8371 }
8372
8373 /**
8374 * Retrieves the URL to an original attachment image.
8375 *
PHP Documentation
<?php
/**
* Filters the path to the original image.
*
* @since 5.3.0
*
* @param string $original_image Path to original image file.
* @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.