Make WordPress Core


Ignore:
Timestamp:
08/20/2008 04:06:36 AM (16 years ago)
Author:
ryan
Message:

Merge crazyhorse management pages. see #7552

File:
1 edited

Legend:

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

    r8656 r8682  
    99/** WordPress Administration Bootstrap */
    1010require_once('admin.php');
     11add_thickbox();
     12wp_enqueue_script('media-upload');
    1113
    1214if (!current_user_can('upload_files'))
     
    1416
    1517// Handle bulk deletes
    16 if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) {
     18if ( isset($_GET['action']) && isset($_GET['media']) ) {
    1719    check_admin_referer('bulk-media');
    18     foreach( (array) $_GET['delete'] as $post_id_del ) {
    19         $post_del = & get_post($post_id_del);
    20 
    21         if ( !current_user_can('delete_post', $post_id_del) )
    22             wp_die( __('You are not allowed to delete this post.') );
    23 
    24         if ( $post_del->post_type == 'attachment' )
    25             if ( ! wp_delete_attachment($post_id_del) )
    26                 wp_die( __('Error in deleting...') );
     20    if ( $_GET['action'] == 'delete' ) {
     21        foreach( (array) $_GET['media'] as $post_id_del ) {
     22            $post_del = & get_post($post_id_del);
     23
     24            if ( !current_user_can('delete_post', $post_id_del) )
     25                wp_die( __('You are not allowed to delete this post.') );
     26
     27            if ( $post_del->post_type == 'attachment' )
     28                if ( ! wp_delete_attachment($post_id_del) )
     29                    wp_die( __('Error in deleting...') );
     30        }
     31
     32        $location = 'upload.php';
     33        if ( $referer = wp_get_referer() ) {
     34            if ( false !== strpos($referer, 'upload.php') )
     35                $location = $referer;
     36        }
     37
     38        $location = add_query_arg('message', 2, $location);
     39        $location = remove_query_arg('posted', $location);
     40        wp_redirect($location);
     41        exit;
    2742    }
    28 
    29     $location = 'upload.php';
    30     if ( $referer = wp_get_referer() ) {
    31         if ( false !== strpos($referer, 'upload.php') )
    32             $location = $referer;
    33     }
    34 
    35     $location = add_query_arg('message', 2, $location);
    36     $location = remove_query_arg('posted', $location);
    37     wp_redirect($location);
    38     exit;
    3943} elseif ( !empty($_GET['_wp_http_referer']) ) {
    4044    wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
     
    6569    printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title));
    6670} else {
    67     $post_mime_type_label = _c('Manage Media|manage media header');
     71    $post_mime_type_label = _c('Media|manage media header');
    6872    if ( isset($_GET['post_mime_type']) && in_array( $_GET['post_mime_type'], array_keys($post_mime_types) ) )
    6973        $post_mime_type_label = $post_mime_types[$_GET['post_mime_type']][1];
     
    8791    $h2_tag    = isset($_GET['tag']) && $_GET['tag'] ? ' ' . sprintf( __('tagged with “%s”'), single_tag_title('', false) ) : '';
    8892    $h2_month  = isset($_GET['m'])   && $_GET['m']   ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : '';
    89     printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month );
     93    printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s (<a href="%7$s" class="thickbox">Add New</a>)|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month, 'media-upload.php?library=false&TB_iframe=true' );
    9094}
    9195?></h2>
     
    156160
    157161<div class="alignleft">
    158 <input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" />
     162<select name="action">
     163<option value="" selected><?php _e('Actions'); ?></option>
     164<option value="delete"><?php _e('Delete'); ?></option>
     165</select>
     166<input type="submit" value="<?php _e('Apply'); ?>" name="doaction" class="button-secondary action" />
    159167<?php wp_nonce_field('bulk-media'); ?>
    160168<?php
Note: See TracChangeset for help on using the changeset viewer.