the_media_upload_tabs

Outputs the legacy media upload tabs UI.

Description

the_media_upload_tabs(); 

Usage

  1. if ( !function_exists( 'the_media_upload_tabs' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/media.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = the_media_upload_tabs(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/media.php  
  1. function the_media_upload_tabs() { 
  2. global $redir_tab; 
  3. $tabs = media_upload_tabs(); 
  4. $default = 'type'; 
  5.  
  6. if ( !empty($tabs) ) { 
  7. echo "<ul id='sidemenu'>\n"; 
  8. if ( isset($redir_tab) && array_key_exists($redir_tab, $tabs) ) { 
  9. $current = $redir_tab; 
  10. } elseif ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) ) { 
  11. $current = $_GET['tab']; 
  12. } else { 
  13. /** This filter is documented in wp-admin/media-upload.php */ 
  14. $current = apply_filters( 'media_upload_default_tab', $default ); 
  15.  
  16. foreach ( $tabs as $callback => $text ) { 
  17. $class = ''; 
  18.  
  19. if ( $current == $callback ) 
  20. $class = " class='current'"; 
  21.  
  22. $href = add_query_arg(array('tab' => $callback, 's' => false, 'paged' => false, 'post_mime_type' => false, 'm' => false)); 
  23. $link = "<a href='" . esc_url($href) . "'$class>$text</a>"; 
  24. echo "\t<li id='" . esc_attr("tab-$callback") . "'>$link</li>\n"; 
  25. echo "</ul>\n";