当前位置: 首页>>代码示例>>PHP>>正文


PHP media_upload_tabs函数代码示例

本文整理汇总了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";
    }
}
开发者ID:HaraShun,项目名称:WordPress,代码行数:32,代码来源:media.php

示例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";
	}
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:25,代码来源:media.php

示例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";
	}
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:32,代码来源:media.php

示例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}");
    }
}
开发者ID:Esleelkartea,项目名称:asociacion-tecnicos-artes-escenicas-ATAE-,代码行数:31,代码来源:media-upload.php


注:本文中的media_upload_tabs函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。