WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 345 | break; |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | return $img; |
| 350 | } |
| 351 | |
| 352 | function stream_preview_image($post_id) { |
| 353 | $post = get_post($post_id); |
| 354 | @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) ); |
| 355 | $img = load_image_to_edit( $post_id, $post->post_mime_type, array(400, 400) ); |
| 356 | |
| 357 | if ( !is_resource($img) ) |
| 358 | return false; |
| 359 | |
| 360 | $changes = !empty($_REQUEST['history']) ? json_decode( stripslashes($_REQUEST['history']) ) : null; |
| 361 | if ( $changes ) |
| 362 | $img = image_edit_apply_changes($img, $changes); |
| 363 | |
| Line | Code |
| 450 | $msg->msg = __('Image restored successfully.'); |
| 451 | |
| 452 | return $msg; |
| 453 | } |
| 454 | |
| 455 | function wp_save_image($post_id) { |
| 456 | $return = new stdClass; |
| 457 | $success = $delete = $scaled = $nocrop = false; |
| 458 | $post = get_post($post_id); |
| 459 | @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) ); |
| 460 | $img = load_image_to_edit($post_id, $post->post_mime_type); |
| 461 | |
| 462 | if ( !is_resource($img) ) { |
| 463 | $return->error = esc_js( __('Unable to create new image.') ); |
| 464 | return $return; |
| 465 | } |
| 466 | |
| 467 | $fwidth = !empty($_REQUEST['fwidth']) ? intval($_REQUEST['fwidth']) : 0; |
| 468 | $fheight = !empty($_REQUEST['fheight']) ? intval($_REQUEST['fheight']) : 0; |