wp_get_video_extensions

函式
wp_get_video_extensions ( No parameters )
返回值
  • (string[]) List of supported video formats.
定義位置
相關方法
wp_get_audio_extensionswp_get_available_translationswp_get_all_sessionswp_get_plugin_file_editable_extensionswp_get_mime_types
引入
3.6.0
棄用
-

wp_get_video_extensions是一個WordPress函式,它返回一個通常用於視訊檔案的副檔名陣列。預設情況下,這個函式返回一個常見視訊副檔名的陣列,如”.mp4″、”.avi”和”.mov”。然而,其他檔案型別可以使用wp_video_extensions過濾器從列表中新增或刪除。在WordPress中處理媒體檔案時,這個功能很有用,特別是在處理視訊檔案時。

返回一個過濾後的支援視訊格式列表。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_get_video_extensions() {
/**
* Filters the list of supported video formats.
*
* @since 3.6.0
*
* @param string[] $extensions An array of supported video formats. Defaults are
* 'mp4', 'm4v', 'webm', 'ogv', 'flv'.
*/
return apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'flv' ) );
}
function wp_get_video_extensions() { /** * Filters the list of supported video formats. * * @since 3.6.0 * * @param string[] $extensions An array of supported video formats. Defaults are * 'mp4', 'm4v', 'webm', 'ogv', 'flv'. */ return apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'flv' ) ); }
function wp_get_video_extensions() {
	/**
	 * Filters the list of supported video formats.
	 *
	 * @since 3.6.0
	 *
	 * @param string[] $extensions An array of supported video formats. Defaults are
	 *                             'mp4', 'm4v', 'webm', 'ogv', 'flv'.
	 */
	return apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'flv' ) );
}

常見問題

FAQs
檢視更多 >