load_image_to_edit_filesystempath
Filter HookDescription
Filters the path to an attachment's file when editing the image. The filter is evaluated for all image sizes except 'full'.Hook Information
File Location |
wp-admin/includes/image.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1212 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$path
|
Path to the current image. |
int
|
$attachment_id
|
Attachment ID. |
string|int[]
|
$size
|
Requested image size. Can be any registered image size name, or an array of width and height values in pixels (in that order). |
Usage Examples
Basic Usage
<?php
// Hook into load_image_to_edit_filesystempath
add_filter('load_image_to_edit_filesystempath', 'my_custom_filter', 10, 3);
function my_custom_filter($path, $attachment_id, $size) {
// Your custom filtering logic here
return $path;
}
Source Code Context
wp-admin/includes/image.php:1212
- How this hook is used in WordPress core
<?php
1207 * @param string $path Path to the current image.
1208 * @param int $attachment_id Attachment ID.
1209 * @param string|int[] $size Requested image size. Can be any registered image size name, or
1210 * an array of width and height values in pixels (in that order).
1211 */
1212 $filepath = apply_filters( 'load_image_to_edit_filesystempath', $filepath, $attachment_id, $size );
1213 }
1214 }
1215 } elseif ( function_exists( 'fopen' ) && ini_get( 'allow_url_fopen' ) ) {
1216 /**
1217 * Filters the path to an attachment's URL when editing the image.
PHP Documentation
<?php
/**
* Filters the path to an attachment's file when editing the image.
*
* The filter is evaluated for all image sizes except 'full'.
*
* @since 3.1.0
*
* @param string $path Path to the current image.
* @param int $attachment_id Attachment ID.
* @param string|int[] $size Requested image size. Can be any registered image size name, or
* an array of width and height values in pixels (in that order).
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-admin/includes/image.php
Related Hooks
Related hooks will be displayed here in future updates.