embed_defaults хук-фильтрWP 2.9.0

Filters the default array of embed dimensions.

Использование

add_filter( 'embed_defaults', 'wp_kama_embed_defaults_filter', 10, 2 );

/**
 * Function for `embed_defaults` filter-hook.
 * 
 * @param int[]  $size Indexed array of the embed width and height in pixels.
 * @param string $url  The URL that should be embedded.
 *
 * @return int[]
 */
function wp_kama_embed_defaults_filter( $size, $url ){

	// filter...
	return $size;
}
$size(int[])

Indexed array of the embed width and height in pixels.

  • 0(int)
    The embed width.

  • 1(int)
    The embed height.
$url(строка)
The URL that should be embedded.

Список изменений

С версии 2.9.0 Введена.

Где вызывается хук

wp_embed_defaults()
embed_defaults
wp-includes/embed.php 91
return apply_filters( 'embed_defaults', compact( 'width', 'height' ), $url );

Где используется хук в WordPress

Использование не найдено.