Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

_wp_add_additional_image_sizes() WordPress Function

The _wp_add_additional_image_sizes() function allows you to add additional image sizes to your WordPress site. This is useful if you want to have different size images for different purposes, or if you want to change the default image sizes.

_wp_add_additional_image_sizes() #

Add additional default image sub-sizes.


Description

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.


Top ↑

Source

File: wp-includes/media.php

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 );
}


Top ↑

Changelog

Changelog
VersionDescription
5.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More