當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。