wp_oembed_get

函式
wp_oembed_get ( $url, $args = '' )
引數
  • (string) $url The URL that should be embedded.
    Required:
  • (array|string) $args { Optional. Additional arguments for retrieving embed HTML. Default empty. @type int|string $width Optional. The `maxwidth` value passed to the provider URL. @type int|string $height Optional. The `maxheight` value passed to the provider URL. @type bool $discover Optional. Determines whether to attempt to discover link tags at the given URL for an oEmbed provider when the provider URL is not found in the built-in providers list. Default true. }
    Required:
    Default: (empty)
返回值
  • (string|false) The embed HTML on success, false on failure.
相關
  • WP_oEmbed
定義位置
相關方法
wp_remote_get_wp_oembed_get_objectwp_embed_defaultswp_oembed_ensure_formatwp_ajax_oembed_cache
引入
2.9.0
棄用
-

wp_oembed_get: 這個函式為一個給定的URL檢索oEmbed資料。它根據所有可用的oEmbed提供者檢查URL,並在一個關聯陣列中返回資料。

試圖使用oEmbed獲取所提供的URL的嵌入HTML。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_oembed_get( $url, $args = '' ) {
$oembed = _wp_oembed_get_object();
return $oembed->get_html( $url, $args );
}
function wp_oembed_get( $url, $args = '' ) { $oembed = _wp_oembed_get_object(); return $oembed->get_html( $url, $args ); }
function wp_oembed_get( $url, $args = '' ) {
	$oembed = _wp_oembed_get_object();
	return $oembed->get_html( $url, $args );
}

常見問題

FAQs
檢視更多 >