wp_expand_dimensions

Advertisement

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

$example_width

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

$example_height

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

$max_width

(int) (Required) The maximum allowed width.

$max_height

(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'],

Advertisement

Changelog Changelog

Changelog
Version Description
2.9.0 Introduced.

See also See also

Advertisement

Leave a Reply

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