本文整理汇总了PHP中media_upload_tabs函数的典型用法代码示例。如果您正苦于以下问题:PHP media_upload_tabs函数的具体用法?PHP media_upload_tabs怎么用?PHP media_upload_tabs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了media_upload_tabs函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: the_media_upload_tabs
/**
* {@internal Missing Short Description}}
*
* @since 2.5.0
*/
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";
}
}
示例2: the_media_upload_tabs
function the_media_upload_tabs() {
global $redir_tab;
$tabs = media_upload_tabs();
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 {
$keys = array_keys($tabs);
$current = array_shift($keys);
}
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='" . clean_url($href) . "'$class>$text</a>";
echo "\t<li id='" . attribute_escape("tab-$callback") . "'>$link</li>\n";
}
echo "</ul>\n";
}
}
示例3: the_media_upload_tabs
/**
* {@internal Missing Short Description}}
*
* @since 2.5.0
*/
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
$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";
}
}
示例4: submit_button
?>
<div id="media-items" class="hide-if-no-js"></div>
<?php
submit_button(__('Save all changes'), 'button savebutton hidden', 'save');
?>
</form>
</div>
<?php
include './admin-footer.php';
} else {
// upload type: image, video, file, ..?
if (isset($_GET['type'])) {
$type = strval($_GET['type']);
} else {
$type = apply_filters('media_upload_default_type', 'file');
}
// tab: gallery, library, or type-specific
if (isset($_GET['tab'])) {
$tab = strval($_GET['tab']);
} else {
$tab = apply_filters('media_upload_default_tab', 'type');
}
$body_id = 'media-upload';
// let the action code decide how to handle the request
if ($tab == 'type' || $tab == 'type_url' || !array_key_exists($tab, media_upload_tabs())) {
do_action("media_upload_{$type}");
} else {
do_action("media_upload_{$tab}");
}
}