load_image_to_edit [ WordPress Function ]
load_image_to_edit ( $attachment_id, $mime_type, $size = 'full' )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: _load_image_to_edit_path, format_to_edit, wp_image_editor, get_image_send_to_editor, wp_load_image
Load an image resource for editing.
Source
<?php
function load_image_to_edit( $attachment_id, $mime_type, $size = 'full' ) {
$filepath = _load_image_to_edit_path( $attachment_id, $size );
if ( empty( $filepath ) )
return false;
switch ( $mime_type ) {
case 'image/jpeg':
$image = imagecreatefromjpeg($filepath);
break;
case 'image/png':
$image = imagecreatefrompng($filepath);
break;
case 'image/gif':
$image = imagecreatefromgif($filepath);
break;
default:
$image = false;
break;
}
if ( is_resource($image) ) {
$image = apply_filters('load_image_to_edit', $image, $attachment_id, $size);
if ( function_exists('imagealphablending') && function_exists('imagesavealpha') ) {
imagealphablending($image, false);
imagesavealpha($image, true);
}
}
return $image;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- load_image_to_edit Wordpress hook details -- Adam Brown, BYU ...
WordPress hook directory load_image_to_edit. WordPress version history for load_image_to_edit. This database has information for all major versions from WP ...
adambrown.info - Docs for page image.php
int $width: Current width of the image; int $height: Current height of the image. load_image_to_edit (line 356). void load_image_to_edit ( $post_id, $mime_type, ...
phpdoc.wordpress.org - /wp-admin/includes/image-edit.php source - PHP Cross Reference ...
Jun 1, 2011 ... 'OK' to continue, 'Cancel' to return to the Image Editor."); ?></div> 196 </div> 197 <?php 198 } 199 200 function load_image_to_edit($post_id, ...
xref.yoast.com - wp_save_image (WordPress Function) - WPSeek.com
@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) ); $img = load_image_to_edit($post_id, $post-> post_mime_type); ...
wpseek.com