function _load_image_to_edit_path( $attachment_id,
$size = 'full'
) { $filepath =
get_attached_file( $attachment_id );
if ( $filepath &&
file_exists( $filepath ) ) { if ( 'full' !==
$size ) { $data =
image_get_intermediate_size( $attachment_id,
$size );
if ( $data ) { $filepath =
path_join( dirname( $filepath ),
$data['file'
] );
/**
* 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).
*/