the_media_upload_tabs() - WordPress 函数参考中文文档

返回介绍

the_media_upload_tabs()

发布于 2017-09-11 字数2175 浏览 942 评论 0

the_media_upload_tabs()

Outputs the legacy media upload tabs UI.


描述


源代码

File: wp-admin/includes/media.php

function the_media_upload_tabs() {
	global $redir_tab;
	$tabs = media_upload_tabs();
	$default = 'type';

	if ( !empty($tabs) ) {
		echo "<ul id='sidemenu'>\n";
		if ( isset($redir_tab) && array_key_exists($redir_tab, $tabs) ) {
			$current = $redir_tab;
		} elseif ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) ) {
			$current = $_GET['tab'];
		} else {
			/** This filter is documented in wp-admin/media-upload.php */
			$current = apply_filters( 'media_upload_default_tab', $default );
		}

		foreach ( $tabs as $callback => $text ) {
			$class = '';

			if ( $current == $callback )
				$class = " class='current'";

			$href = add_query_arg(array('tab' => $callback, 's' => false, 'paged' => false, 'post_mime_type' => false, 'm' => false));
			$link = "<a href='" . esc_url($href) . "'$class>$text</a>";
			echo "\t<li id='" . esc_attr("tab-$callback") . "'>$link</li>\n";
		}
		echo "</ul>\n";
	}
}

更新日志

Version 描述
2.5.0 Introduced.

相关函数

Uses

  • wp-admin/media-upload.php:
    media_upload_default_tab
  • wp-admin/includes/media.php:
    media_upload_tabs()
  • wp-includes/formatting.php:
    esc_url()
  • wp-includes/formatting.php:
    esc_attr()
  • wp-includes/functions.php:
    add_query_arg()
  • wp-includes/plugin.php:
    apply_filters()
  • Show 1 more use
    Hide more uses


Used By

  • wp-admin/includes/media.php:
    media_upload_header()

User Contributed Notes

上一篇:the_ID()

下一篇:the_meta()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!