Make WordPress Core

Ticket #13847: 13847.2.diff

File 13847.2.diff, 1.4 KB (added by wpmuguru, 14 years ago)

apply the admin_memory_limit filter throughout wp-admin

  • wp-admin/includes/file.php

     
    563563                return new WP_Error('fs_unavailable', __('Could not access filesystem.'));
    564564
    565565        // Unzip can use a lot of memory, but not this much hopefully
    566         @ini_set('memory_limit', '256M');
     566        @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', '256M' ) );
    567567
    568568        $needed_dirs = array();
    569569        $to = trailingslashit($to);
  • wp-admin/includes/image-edit.php

     
    391391
    392392function stream_preview_image($post_id) {
    393393        $post = get_post($post_id);
    394         @ini_set('memory_limit', '256M');
     394        @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', '256M' ) );
    395395        $img = load_image_to_edit( $post_id, $post->post_mime_type, array(400, 400) );
    396396
    397397        if ( !is_resource($img) )
     
    496496        $return = new stdClass;
    497497        $success = $delete = $scaled = $nocrop = false;
    498498        $post = get_post($post_id);
    499         @ini_set('memory_limit', '256M');
     499        @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', '256M' ) );
    500500        $img = load_image_to_edit($post_id, $post->post_mime_type);
    501501
    502502        if ( !is_resource($img) ) {