stream_preview_image [ WordPress Function ]
stream_preview_image ( $post_id )
| Defined at: |
|
Soorgelijke functies: wp_stream_image, post_preview, _set_preview, is_random_header_image, is_preview
No description yet.
Source
<?php
function stream_preview_image($post_id) {
$post = get_post($post_id);
@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
$img = load_image_to_edit( $post_id, $post->post_mime_type, array(400, 400) );
if ( !is_resource($img) )
return false;
$changes = !empty($_REQUEST['history']) ? json_decode( stripslashes($_REQUEST['history']) ) : null;
if ( $changes )
$img = image_edit_apply_changes($img, $changes);
// scale the image
$w = imagesx($img);
$h = imagesy($img);
$ratio = _image_get_preview_ratio($w, $h);
$w2 = $w * $ratio;
$h2 = $h * $ratio;
$preview = wp_imagecreatetruecolor($w2, $h2);
imagecopyresampled( $preview, $img, 0, 0, 0, 0, $w2, $h2, $w, $h );
wp_stream_image($preview, $post->post_mime_type, $post_id);
imagedestroy($preview);
imagedestroy($img);
return true;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- stream_preview_image (WordPress Function) - WPSeek.com
WordPress lookup for stream_preview_image, a WordPress Function. wpseek. com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - Docs for page image-edit.php
stream_preview_image (line 352). void stream_preview_image ( $post_id). $ post_id. wp_image_editor (line 9). WordPress Image Editor. void wp_image_editor ...
phpdoc.wordpress.org - trunk
... settings_errors · settings_fields · set_current_screen · set_screen_options · show_message · sort_menu · stream_preview_image · submit_button · tag_exists ...
phpdoc.wordpress.org - stream_preview_image | A HitchHackers guide through WordPress
Feb 12, 2011 ... Definition: function stream_preview_image($post_id) {} ... function stream_preview_image($post_id) { $post = get_post($post_id); @ini_set( ...
hitchhackerguide.com