WordPress at a glance

wp_get_additional_image_sizes() WP 4.7.0

Gets data of all additionally registered image sizes (thumbnails).

By default WordPress has four image sizes: thumbnail, medium, medium_large, large. Using add_image_size() function, You can add additional image sizes. Now, to get all these extra sizes, you can use this function.

  • Uses global variable $_wp_additional_image_sizes.

Array. Additional images size data.

1 time = 0.000024s = very fast | 50000 times = 0.01s = speed of light | PHP 7.1.5, WP 4.8.2

No Hooks.




#1 Get additional image sizes

We will get such array if to use this function for twentyfifteen theme that has one additional image size: post-thumbnail.

print_r( wp_get_additional_image_sizes() );

/* Output
	[post-thumbnail] => Array(
		[width]  => 825
		[height] => 510
		[crop]   => 1


  • Global. Array. $_wp_additional_image_sizes

Список изменений

С версии 4.7.0 Введена.

Code of wp_get_additional_image_sizes() WP 5.5.1

function wp_get_additional_image_sizes() {
	global $_wp_additional_image_sizes;

	if ( ! $_wp_additional_image_sizes ) {
		$_wp_additional_image_sizes = array();

	return $_wp_additional_image_sizes;

Related Functions

From tag: image (not thumbnails funcs)

More from category: Thumbnails

vladlu 100vlad.lu
Editors: kama 100
No comments
    Log In . Register