images - What sense makes medium_large_size_h => 0?

WP Version 5.4.2There is an image size definition of medium_large with size_w = 768 and size_h = 0 -You can find it ne

WP Version 5.4.2 There is an image size definition of medium_large with size_w = 768 and size_h = 0 - You can find it near line 530 of wp-admin/includes/schema.php:

// 4.4.0
'medium_large_size_w'             => 768,
'medium_large_size_h'             => 0,

I'm wondering what sense this definition makes?

WP Version 5.4.2 There is an image size definition of medium_large with size_w = 768 and size_h = 0 - You can find it near line 530 of wp-admin/includes/schema.php:

// 4.4.0
'medium_large_size_w'             => 768,
'medium_large_size_h'             => 0,

I'm wondering what sense this definition makes?

Share Improve this question asked Jul 7, 2020 at 17:05 TomTom 131 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

It appears that it's eventually used as a parameter to wp_constrain_dimensions where '0' means 'no limit'.

It's only used directly in media.php:85

  } elseif ( 'medium_large' === $size ) {
    $max_width  = intval( get_option( 'medium_large_size_w' ) );
    $max_height = intval( get_option( 'medium_large_size_h' ) );

    if ( intval( $content_width ) > 0 ) {
      $max_width = min( intval( $content_width ), $max_width );
    }

$max_height then used at :135

return wp_constrain_dimensions( $width, $height, $max_width, $max_height );

Docs here show 0 means no limit

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742284480a4415080.html

相关推荐

  • images - What sense makes medium_large_size_h => 0?

    WP Version 5.4.2There is an image size definition of medium_large with size_w = 768 and size_h = 0 -You can find it ne

    20小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信