WordPress at a glance

get_intermediate_image_sizes() WP 1.0

Gets the available intermediate image sizes.

✈ 1 time = 0.000018s = very fast | 50000 times = 0.14s = very fast | PHP 7.0.5, WP 4.5.2
Hooks from the function
Return

Array. Returns a filtered array of image size strings.

Usage

get_intermediate_image_sizes();

Changelog

Since 3.0.0 Introduced.

Code of get intermediate image sizes: wp-includes/media.php WP 5.3.2

<?php
function get_intermediate_image_sizes() {
	$default_sizes    = array( 'thumbnail', 'medium', 'medium_large', 'large' );
	$additional_sizes = wp_get_additional_image_sizes();

	if ( ! empty( $additional_sizes ) ) {
		$default_sizes = array_merge( $default_sizes, array_keys( $additional_sizes ) );
	}

	/**
	 * Filters the list of intermediate image sizes.
	 *
	 * @since 2.5.0
	 *
	 * @param array $default_sizes An array of intermediate image sizes. Defaults
	 *                             are 'thumbnail', 'medium', 'medium_large', 'large'.
	 */
	return apply_filters( 'intermediate_image_sizes', $default_sizes );
}

Related Functions

From tag: Thumbnail (images)

More from category: Thumbnails

No comments
        Log In . Register