WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/27/2008 08:31:10 AM (12 years ago)
Author:
ryan
Message:

Add media library uploader tab. Props andy. see #5911

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upload.php

    r7057 r7062  
    3838require_once('admin-header.php');
    3939
    40 add_filter( 'post_limits', $limit_filter = create_function( '$a', 'if ( empty($_GET["paged"]) ) $_GET["paged"] = 1; $start = ( intval($_GET["paged"]) - 1 ) * 15; return "LIMIT $start, 20";' ) );
     40if ( isset($_GET['paged']) && $start = ( intval($_GET['paged']) - 1 ) * 15 )
     41    add_filter( 'post_limits', $limit_filter = create_function( '$a', "return 'LIMIT $start, 15';" ) );
    4142list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
    4243$wp_query->max_num_pages = ceil( $wp_query->found_posts / 15 ); // We grab 20 but only show 15 ( 5 more for ajax extra )
     
    8283<ul class="subsubsub">
    8384<?php
    84 $status_links = array();
     85$type_links = array();
    8586$_num_posts = (array) wp_count_attachments();
    8687$matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
     
    9798        $class = ' class="current"';
    9899
    99     $status_links[] = "<li><a href=\"upload.php?post_mime_type=$mime_type\"$class>" .
     100    $type_links[] = "<li><a href=\"upload.php?post_mime_type=$mime_type\"$class>" .
    100101    sprintf($label[2], $num_posts[$mime_type]) . '</a>';
    101102}
    102103$class = empty($_GET['post_mime_type']) ? ' class="current"' : '';
    103 $status_links[] = "<li><a href=\"upload.php\"$class>".__('All Types')."</a>";
    104 echo implode(' |</li>', $status_links) . '</li>';
    105 unset($status_links);
     104$type_links[] = "<li><a href=\"upload.php\"$class>".__('All Types')."</a>";
     105echo implode(' | </li>', $type_links) . '</li>';
     106unset($type_links);
    106107?>
    107108</ul>
Note: See TracChangeset for help on using the changeset viewer.