WordPress.org

Ready to get started?Download WordPress

Codex

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

zh-cn:Function Reference/get embedded media

Contents

概述

按照顺序坚持内容块是否存在如下HTML标签:<{media type}>, <object>, <embed>, or <iframe>。 如未找到任何HTML标签,则检查日志的第一行查找URL。

用法

 <?php get_embedded_media$type, &$content$remove$limit )  ?> 

传入参数

$type
(string) (required) Type of media: audio or video.
Default: None
$content
(string) (required) A string which might contain media data.
Default: None
$remove
(boolean) (optional) Whether to remove the found URL from the passed content.
Default: false
$limit
(integer) (optional) The number of galleries to return.
Default: 0

返回值

(array) 
A list of found HTML media embeds and possibly a URL by itself.

使用样例

变更记录

源码文件

get_embedded_media() 函数在源码文件 wp-includes/media.php..

相关函数

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()

Audio: wp_audio_shortcode(), wp_get_audio_extensions(), get_attached_audio(), get_attached_media(), get_embedded_audio(), get_embedded_media(), wp_embed_handler_audio(), wp_mediaelement_fallback(), wp_read_audio_metadata(), wp_add_id3_tag_data(), the_post_format_audio(), get_the_post_format_media(), get_content_audio(), get_content_media()

Video: wp_video_shortcode(), wp_get_video_extensions(), get_attached_video(), get_attached_media(), get_embedded_video(), get_embedded_media(), wp_embed_handler_video(), wp_mediaelement_fallback(), wp_read_video_metadata(), wp_add_id3_tag_data(), the_post_format_video(), get_the_post_format_media(), get_content_video(), get_content_media()

See also index of Function Reference and index of Template Tags.