_wp_add_additional_image_sizes
函数
_wp_add_additional_image_sizes ( No parameters )
- Access
- Private
- 定义位置
-
-
wp-includes/media.php
, line 5250
-
wp-includes/media.php
- 引入
- 5.3.0
- 弃用
- –
Adds additional default image sub-sizes.
These sizes are meant to enhance the way WordPress displays images on the front-end on larger,
high-density devices. They make it possible to generate more suitable `srcset` and `sizes` attributes
when the users upload large images.
The sizes can be changed or removed by themes and plugins but that is not recommended.
The size “names” reflect the image dimensions, so changing the sizes would be quite misleading.
function _wp_add_additional_image_sizes() { // 2x medium_large size. add_image_size( '1536x1536', 1536, 1536 ); // 2x large size. add_image_size( '2048x2048', 2048, 2048 ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。