wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



wp_expand_dimensions › WordPress Function

Od2.9.0
Przestarzałyn/a
wp_expand_dimensions ( $example_width, $example_height, $max_width, $max_height )
Parametry: (4)
  • (int) $example_width The width of an example embed.
    Wymagane: Tak
  • (int) $example_height The height of an example embed.
    Wymagane: Tak
  • (int) $max_width The maximum allowed width.
    Wymagane: Tak
  • (int) $max_height The maximum allowed height.
    Wymagane: Tak
Zobacz:
Powrót:
  • (int[]) { An array of maximum width and height values. @type int $0 The maximum width in pixels. @type int $1 The maximum height in pixels. }
Zdefiniowane na:
Codex:

Based on a supplied width/height example, returns the biggest possible dimensions based on the max width/height.



Źródło

function wp_expand_dimensions( $example_width, $example_height, $max_width, $max_height ) {
	$example_width  = (int) $example_width;
	$example_height = (int) $example_height;
	$max_width      = (int) $max_width;
	$max_height     = (int) $max_height;

	return wp_constrain_dimensions( $example_width * 1000000, $example_height * 1000000, $max_width, $max_height );
}