WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp embed defaults

This page is marked as incomplete. You can help Codex by expanding it.

Description

Create default array of embed parameters.

The width defaults to the content width as specified by the theme in the $content_width global. If the theme does not specify a content width, then 500px is used.

The default height is 1.5 times the width, or 1000px, whichever is smaller. The 'embed_defaults' filter can be used to adjust either of these values.

Usage

<?php wp_embed_defaults(); ?>

Parameters

This function does not accept parameters

Return Values

(array) 
Default embed parameters.

Examples

<?php

$defaults = wp_embed_defaults();

var_dump( $defaults );

/* Example output:

array(2) {
  ["width"]=>
  int(625)
  ["height"]=>
  float(938)
}

*/

?>

Notes

Change Log

Since: 2.9.0

Source File

wp_embed_defaults() is located in wp-includes/media.php

Related

Embeds: wp_oembed_add_provider(), wp_oembed_remove_provider(), wp_oembed_get(), wp_embed_defaults(), wp_embed_register_handler(), wp_embed_unregister_handler(), get_embedded_audio(), get_embedded_media(), get_embedded_video(), wp_embed_handler_audio(), wp_embed_handler_video()