Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_expand_dimensions ›

Da2.9.0
Deprecaton/a
wp_expand_dimensions ( $example_width, $example_height, $max_width, $max_height )
Parametri: (4)
  • (int) $example_width The width of an example embed.
    Richiesto:
  • (int) $example_height The height of an example embed.
    Richiesto:
  • (int) $max_width The maximum allowed width.
    Richiesto:
  • (int) $max_height The maximum allowed height.
    Richiesto:
Vedi:
Ritorna:
  • (array) The maximum possible width and height based on the example ratio.
Definito a:
Codex:

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



Sorgenti

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