Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #47713, comment 10


Ignore:
Timestamp:
09/05/2020 05:25:42 PM (4 years ago)
Author:
Mista-Flo
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #47713, comment 10

    initial v1  
    22
    33@mahnunchik
     4
     5Here's what I tried:
     6
     7{{{#!php
     8<?php
     9                add_image_size( 'test-size', 500, 500, true );
     10
     11                $file = DIR_TESTDATA . '/images/test_500x500.png';
     12                $id   = $this->_make_attachment( $file, 0 );
     13
     14                // Look for a size by name.
     15                $image = image_get_intermediate_size( $id, 'test-size' );
     16                var_dump( $image );
     17
     18                $image = image_get_intermediate_size( $id, [500, 500] );
     19                var_dump( $image );
     20}}}
     21
     22It always output the same thing, with trunk version, with your first patch applied or with your second one.
     23
     24
     25{{{
     26array(6) {
     27  ["file"]=>
     28  string(24) "test_500x500-500x500.png"
     29  ["width"]=>
     30  int(500)
     31  ["height"]=>
     32  int(500)
     33  ["mime-type"]=>
     34  string(9) "image/png"
     35  ["path"]=>
     36  string(32) "2020/09/test_500x500-500x500.png"
     37  ["url"]=>
     38  string(70) "http://example.org/wp-content/uploads/2020/09/test_500x500-500x500.png"
     39}
     40}}}