返回介绍

wp_get_video_extensions()

发布于 2017-09-11 12:09:59 字数 2635 浏览 855 评论 0 收藏 0

wp_get_video_extensions()

Returns a filtered list of WP-supported video formats.


description


返回值

(array) List of supported video formats.


源代码

File: wp-includes/media.php

function wp_get_video_extensions() {
	/**
	 * Filters the list of supported video formats.
	 *
	 * @since 3.6.0
	 *
	 * @param array $extensions An array of support video formats. Defaults are
	 *                          'mp4', 'm4v', 'webm', 'ogv', 'flv'.
	 */
	return apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'flv' ) );
}

更新日志

Versiondescription
3.6.0Introduced.

相关函数

Uses

  • wp-includes/plugin.php: apply_filters()
  • wp-includes/media.php: wp_video_extensions

Used By

  • wp-includes/widgets/class-wp-widget-media-video.php: WP_Widget_Media_Video::__construct()
  • wp-includes/widgets/class-wp-widget-media-video.php: WP_Widget_Media_Video::get_instance_schema()
  • wp-includes/post.php: wp_attachment_is()
  • wp-admin/includes/schema.php: populate_network()
  • wp-includes/media.php: wp_enqueue_media()
  • wp-includes/embed.php: wp_maybe_load_embeds()
  • wp-includes/media.php: wp_video_shortcode()
  • wp-includes/media-template.php: wp_underscore_video_template()
  • wp-includes/media-template.php: wp_print_media_templates()
  • Show 4 more used by Hide more used by

User Contributed Notes

  1. Skip to note content You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note Contributed by Codex

    Print an array of default WordPress-supported video extensions

    
    $video_extensions = wp_get_video_extensions();
    print_r( $video_extensions );
    

    Output:

    Array
    (
        [0] => mp4
        [1] => m4v
        [2] => webm
        [3] => ogv
        [4] => wmv
        [5] => flv
    )

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文