mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 06:29:30 +00:00
Allow better contextual based filtering of the path to the image being edited by having specific filters for local filesystem and url based paths.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8b62d686ca
commit
a4908141b8
@ -201,10 +201,11 @@ function load_image_to_edit($post_id, $mime_type, $size = 'full') {
|
||||
$filepath = get_attached_file($post_id);
|
||||
|
||||
if ( $filepath && file_exists($filepath) ) {
|
||||
if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) )
|
||||
$filepath = path_join( dirname($filepath), $data['file'] );
|
||||
if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) ) {
|
||||
$filepath = apply_filters('load_image_to_edit_filesystempath', path_join( dirname($filepath), $data['file'] ), $post_id, $size);
|
||||
}
|
||||
} elseif ( WP_Http_Fopen::test() ) {
|
||||
$filepath = wp_get_attachment_url($post_id);
|
||||
$filepath = apply_filters('load_image_to_edit_attachmenturl', wp_get_attachment_url($post_id) , $post_id, $size);
|
||||
}
|
||||
|
||||
$filepath = apply_filters('load_image_to_edit_path', $filepath, $post_id, $size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user