Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: admin_memory_limit

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
385                     break;
386           }
387      }
388
389      return $img;
390 }
391
392 function stream_preview_image($post_id) {
393      $post = get_post($post_id);
394      @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
395      $img = load_image_to_edit( $post_id, $post->post_mime_type, array(400, 400) );
396
397      if ( !is_resource($img) )
398           return false;
399
400      $changes = !empty($_REQUEST['history']) ? json_decode( stripslashes($_REQUEST['history']) ) : null;
401      if ( $changes )
402           $img = image_edit_apply_changes($img, $changes);
403
 
Line Code
490           $msg->msg = __('Image restored successfully.');
491
492      return $msg;
493 }
494
495 function wp_save_image($post_id) {
496      $return = new stdClass;
497      $success = $delete = $scaled = $nocrop = false;
498      $post = get_post($post_id);
499      @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
500      $img = load_image_to_edit($post_id, $post->post_mime_type);
501
502      if ( !is_resource($img) ) {
503           $return->error = esc_js( __('Unable to create new image.') );
504           return $return;
505      }
506
507      $fwidth = !empty($_REQUEST['fwidth']) ? intval($_REQUEST['fwidth']) : 0;
508      $fheight = !empty($_REQUEST['fheight']) ? intval($_REQUEST['fheight']) : 0;