media_upload_tabs

函式
media_upload_tabs ( No parameters )
返回值
  • (string[]) Default tabs.
定義位置
相關方法
the_media_upload_tabsmedia_upload_audiomedia_upload_imagemedia_upload_headermedia_upload_html_bypass
引入
2.5.0
棄用
-

media_upload_tabs – 這個動作是用來給媒體上傳表格新增自定義標籤的。它允許開發者在上傳介面上新增自己的功能,為使用者提供額外的選項。

定義了預設的媒體上傳標籤。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function media_upload_tabs() {
$_default_tabs = array(
'type' => __( 'From Computer' ), // Handler action suffix => tab text.
'type_url' => __( 'From URL' ),
'gallery' => __( 'Gallery' ),
'library' => __( 'Media Library' ),
);
/**
* Filters the available tabs in the legacy (pre-3.5.0) media popup.
*
* @since 2.5.0
*
* @param string[] $_default_tabs An array of media tabs.
*/
return apply_filters( 'media_upload_tabs', $_default_tabs );
}
function media_upload_tabs() { $_default_tabs = array( 'type' => __( 'From Computer' ), // Handler action suffix => tab text. 'type_url' => __( 'From URL' ), 'gallery' => __( 'Gallery' ), 'library' => __( 'Media Library' ), ); /** * Filters the available tabs in the legacy (pre-3.5.0) media popup. * * @since 2.5.0 * * @param string[] $_default_tabs An array of media tabs. */ return apply_filters( 'media_upload_tabs', $_default_tabs ); }
function media_upload_tabs() {
	$_default_tabs = array(
		'type'     => __( 'From Computer' ), // Handler action suffix => tab text.
		'type_url' => __( 'From URL' ),
		'gallery'  => __( 'Gallery' ),
		'library'  => __( 'Media Library' ),
	);

	/**
	 * Filters the available tabs in the legacy (pre-3.5.0) media popup.
	 *
	 * @since 2.5.0
	 *
	 * @param string[] $_default_tabs An array of media tabs.
	 */
	return apply_filters( 'media_upload_tabs', $_default_tabs );
}

常見問題

FAQs
檢視更多 >