Summery Summery

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

Syntax Syntax

wp_expand_dimensions( int $example_width, int $example_height, int $max_width, int $max_height )

Parameters Parameters


(int) (Required) The width of an example embed.


(int) (Required) The height of an example embed.


(int) (Required) The maximum allowed width.


(int) (Required) The maximum allowed height.

Return Return

(int[]) An array of maximum width and height values.

  • (int) The maximum width in pixels.
  • '1'
    (int) The maximum height in pixels.

Source Source

File: wp-includes/media.php

		'class'    => $atts['class'],
		'id'       => sprintf( 'video-%d-%d', $post_id, $instance ),
		'width'    => absint( $atts['width'] ),
		'height'   => absint( $atts['height'] ),
		'poster'   => esc_url( $atts['poster'] ),
		'loop'     => wp_validate_boolean( $atts['loop'] ),
		'autoplay' => wp_validate_boolean( $atts['autoplay'] ),
		'preload'  => $atts['preload'],


Changelog Changelog

Version Description
2.9.0 Introduced.

See also See also


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.