diff --git a/wp-admin/categories.php b/wp-admin/categories.php index a1e6c91b1..ea7a80be5 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -10,11 +10,10 @@ require_once('admin.php'); $title = __('Categories'); -$parent_file = 'edit.php'; wp_reset_vars(array('action', 'cat')); -if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) +if ( $_GET['action'] == 'delete' && isset($_GET['delete']) ) $action = 'bulk-delete'; switch($action) { @@ -127,11 +126,7 @@ endif; ?>
- -

add new)'), '#addcat') ?>

- -

- +

Add New)') : __('Manage Tags'), '#addcat' ); ?>

@@ -162,7 +157,11 @@ if ( $page_links ) ?>

- + +
diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index 462fe98db..50c23d5f3 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -50,13 +50,22 @@ foreach($posts_columns as $column_name=>$column_display_name) { case 'cb': ?> - + - ID, array(80, 60), false, true); ?> + ID, array(80, 60), true ) ) { +?> + + "> + + + + $column_display_name) { ?> ">
ID))); ?> +

+ "> | + | + +

ID); ?> + slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . ""; + echo join( ', ', $out ); + } else { + _e('No Tags'); + } + ?> + post_excerpt : ''; ?> @@ -106,7 +136,7 @@ foreach($posts_columns as $column_name=>$column_display_name) { $title = $parent_title; } ?> - + , @@ -132,9 +162,12 @@ foreach($posts_columns as $column_name=>$column_display_name) { - + + "> | + + get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment) ); if ( !current_user_can('edit_post', $post_id) ) continue; - if ( !empty( $_REQUEST['spamit'] ) ) { + if ( $_REQUEST['action'] == 'markspam' ) { wp_set_comment_status($comment, 'spam'); $comments_spammed++; - } elseif ( !empty( $_REQUEST['deleteit'] ) ) { + } elseif ( $_REQUEST['action'] == 'delete' ) { wp_set_comment_status($comment, 'delete'); $comments_deleted++; - } elseif ( !empty( $_REQUEST['approveit'] ) ) { + } elseif ( $_REQUEST['action'] == 'approve' ) { wp_set_comment_status($comment, 'approve'); $comments_approved++; - } elseif ( !empty( $_REQUEST['unapproveit'] ) ) { + } elseif ( $_REQUEST['action'] == 'unapprove' ) { wp_set_comment_status($comment, 'hold'); $comments_unapproved++; } @@ -106,7 +105,11 @@ if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['sp sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "" . number_format_i18n($num_comments->moderated) . ""), 'approved' => _c('Approved|plural')); +$stati = array( + 'moderated' => sprintf(__ngettext('Awaiting Moderation (%s)', 'Awaiting Moderation (%s)', number_format_i18n($num_comments->moderated) ), "" . number_format_i18n($num_comments->moderated) . ""), + 'approved' => _c('Approved|plural'), + 'spam' => sprintf(__ngettext('Spam (%s)', 'Spam (%s)', number_format_i18n($num_comments->spam) ), "" . number_format_i18n($num_comments->spam) . "") + ); $class = ( '' === $comment_status ) ? ' class="current"' : ''; $status_links[] = "
  • ".__('Show All Comments').""; foreach ( $stati as $status => $label ) { @@ -115,7 +118,8 @@ foreach ( $stati as $status => $label ) { if ( $status == $comment_status ) $class = ' class="current"'; - $status_links[] = "
  • " . $label . ''; + + $status_links[] = "
  • $label"; } $status_links = apply_filters( 'comment_status_links', $status_links ); @@ -135,10 +139,12 @@ unset($status_links);
  • +
    - - + - - + + - + + + @@ -202,9 +213,10 @@ if ($comments) { - - - + + + + diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php index f5af5c626..e639dd7c0 100644 --- a/wp-admin/edit-link-categories.php +++ b/wp-admin/edit-link-categories.php @@ -9,40 +9,41 @@ /** WordPress Administration Bootstrap */ require_once('admin.php'); -// Handle bulk deletes -if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) { +// Handle bulk actions +if ( isset($_GET['action']) && isset($_GET['delete']) ) { check_admin_referer('bulk-link-categories'); if ( !current_user_can('manage_categories') ) wp_die(__('Cheatin’ uh?')); + + if ( $_GET['action'] == 'delete' ) { + foreach( (array) $_GET['delete'] as $cat_ID ) { + $cat_name = get_term_field('name', $cat_ID, 'link_category'); + $default_cat_id = get_option('default_link_category'); - foreach( (array) $_GET['delete'] as $cat_ID ) { - $cat_name = get_term_field('name', $cat_ID, 'link_category'); - $default_cat_id = get_option('default_link_category'); + // Don't delete the default cats. + if ( $cat_ID == $default_cat_id ) + wp_die(sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name)); - // Don't delete the default cats. - if ( $cat_ID == $default_cat_id ) - wp_die(sprintf(__("Can’t delete the %s category: this is the default one"), $cat_name)); + wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); + } - wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id)); + $location = 'edit-link-categories.php'; + if ( $referer = wp_get_referer() ) { + if ( false !== strpos($referer, 'edit-link-categories.php') ) + $location = $referer; + } + + $location = add_query_arg('message', 6, $location); + wp_redirect($location); + exit(); } - - $location = 'edit-link-categories.php'; - if ( $referer = wp_get_referer() ) { - if ( false !== strpos($referer, 'edit-link-categories.php') ) - $location = $referer; - } - - $location = add_query_arg('message', 6, $location); - wp_redirect($location); - exit(); } elseif ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; } $title = __('Link Categories'); -$parent_file = 'edit.php'; wp_enqueue_script( 'admin-categories' ); wp_enqueue_script('admin-forms'); @@ -64,11 +65,7 @@ endif; ?>
    - -

    add new)'), '#addcat') ?>

    - -

    - +

    Add New)') : __('Manage Tags'), '#addcat' ); ?>

    @@ -99,7 +96,11 @@ if ( $page_links ) ?>

    - + +
    diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php index f66b10acb..65f323403 100644 --- a/wp-admin/edit-pages.php +++ b/wp-admin/edit-pages.php @@ -10,30 +10,32 @@ require_once('admin.php'); // Handle bulk deletes -if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) { +if ( isset($_GET['action']) && isset($_GET['delete']) ) { check_admin_referer('bulk-pages'); - foreach( (array) $_GET['delete'] as $post_id_del ) { - $post_del = & get_post($post_id_del); + if ( $_GET['action'] == 'delete' ) { + foreach( (array) $_GET['delete'] as $post_id_del ) { + $post_del = & get_post($post_id_del); - if ( !current_user_can('delete_page', $post_id_del) ) - wp_die( __('You are not allowed to delete this page.') ); + if ( !current_user_can('delete_page', $post_id_del) ) + wp_die( __('You are not allowed to delete this page.') ); - if ( $post_del->post_type == 'attachment' ) { - if ( ! wp_delete_attachment($post_id_del) ) - wp_die( __('Error in deleting...') ); - } else { - if ( !wp_delete_post($post_id_del) ) - wp_die( __('Error in deleting...') ); + if ( $post_del->post_type == 'attachment' ) { + if ( ! wp_delete_attachment($post_id_del) ) + wp_die( __('Error in deleting...') ); + } else { + if ( !wp_delete_post($post_id_del) ) + wp_die( __('Error in deleting...') ); + } } + + $sendback = wp_get_referer(); + if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php'); + elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); + $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); + + wp_redirect($sendback); + exit(); } - - $sendback = wp_get_referer(); - if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php'); - elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); - $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); - - wp_redirect($sendback); - exit(); } elseif ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; @@ -51,7 +53,7 @@ $post_stati = array( // array( adj, noun ) 'private' => array(__('Private'), __('Private pages'), __ngettext_noop('Private (%s)', 'Private (%s)')) ); -$post_status_label = __('Manage Pages'); +$post_status_label = __('Pages'); $post_status_q = ''; if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) { $post_status_label = $post_stati[$_GET['post_status']][1]; @@ -79,7 +81,7 @@ if ( isset($_GET['author']) && $_GET['author'] ) { $author_user = get_userdata( (int) $_GET['author'] ); $h2_author = ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name )); } -printf( _c( '%1$s%2$s%3$s|You can reorder these: 1: Pages, 2: by {s}, 3: matching {s}' ), $post_status_label, $h2_author, $h2_search ); +printf( _c( '%1$s%2$s%3$s (Add New)|You can reorder these: 1: Pages, 2: by {s}, 3: matching {s}' ), $post_status_label, $h2_author, $h2_search, 'page-new.php' ); ?>
      @@ -146,7 +148,11 @@ if ( $page_links ) ?>
      - + +
      diff --git a/wp-admin/edit-post-rows.php b/wp-admin/edit-post-rows.php index 313e228f3..58a3271b3 100644 --- a/wp-admin/edit-post-rows.php +++ b/wp-admin/edit-post-rows.php @@ -58,7 +58,7 @@ foreach($posts_columns as $column_name=>$column_display_name) { case 'cb': ?> - ID ) ) { ?> + ID ) ) { ?> $column_display_name) { $h_time = mysql2date(__('Y/m/d'), $m_time); } } - ?> - - + + + + - ID ) ) { ?>"> - post_password) ) { _e(' — Protected'); } elseif ('private' == $post->post_status) { _e(' — Private'); } ?> + ID ) ) { ?>"> + post_password) ) { _e(' — Protected'); } elseif ('private' == $post->post_status) { _e(' — Private'); } + + if ( 'excerpt' == $mode ) + the_excerpt(); + + $actions = array(); + $actions['edit'] = '' . __('Edit') . ''; + $actions['delete'] = "post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . ""; + $action_count = count($actions); + $i = 0; + foreach ( $actions as $action => $link ) { + ++$i; + ( $i == $action_count ) ? $sep = '' : $sep = ' | '; + echo "$link$sep"; + } + ?> +
      - -

      add new)'), '#addtag') ?>

      - -

      - +

      Add New)') : __('Manage Tags'), '#addtag' ); ?>

      @@ -169,7 +164,11 @@ if ( $page_links ) ?>

      - + +
      diff --git a/wp-admin/edit.php b/wp-admin/edit.php index beedbed29..a104861d9 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -9,24 +9,32 @@ /** WordPress Administration Bootstrap */ require_once('admin.php'); -// Handle bulk deletes -if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) { - check_admin_referer('bulk-posts'); - foreach( (array) $_GET['delete'] as $post_id_del ) { - $post_del = & get_post($post_id_del); +// Handle bulk actions +if ( isset($_GET['action']) && $_GET['action'] != 'Actions' ) { + switch ( $_GET['action'] ) { + case 'delete': + if ( isset($_GET['post']) ) { + check_admin_referer('bulk-posts'); + foreach( (array) $_GET['post'] as $post_id_del ) { + $post_del = & get_post($post_id_del); - if ( !current_user_can('delete_post', $post_id_del) ) - wp_die( __('You are not allowed to delete this post.') ); + if ( !current_user_can('delete_post', $post_id_del) ) + wp_die( __('You are not allowed to delete this post.') ); - if ( $post_del->post_type == 'attachment' ) { - if ( ! wp_delete_attachment($post_id_del) ) - wp_die( __('Error in deleting...') ); - } else { - if ( !wp_delete_post($post_id_del) ) - wp_die( __('Error in deleting...') ); - } + if ( $post_del->post_type == 'attachment' ) { + if ( ! wp_delete_attachment($post_id_del) ) + wp_die( __('Error in deleting...') ); + } else { + if ( !wp_delete_post($post_id_del) ) + wp_die( __('Error in deleting...') ); + } + } + } + break; + case 'edit': + // TODO: Decide what to do here - add bulk edit feature, or just disallow if >1 post selected + break; } - $sendback = wp_get_referer(); if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('post-new.php'); elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); @@ -52,6 +60,10 @@ require_once('admin-header.php'); if ( !isset( $_GET['paged'] ) ) $_GET['paged'] = 1; +if ( empty($_GET['mode']) ) + $mode = 'list'; +else + $mode = attribute_escape($_GET['mode']); ?>
      @@ -61,7 +73,7 @@ if ( !isset( $_GET['paged'] ) ) if ( is_single() ) { printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title)); } else { - $post_status_label = _c('Manage Posts|manage posts header'); + $post_status_label = _c('Posts|manage posts header'); if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) ) $post_status_label = $post_stati[$_GET['post_status']][1]; //if ( $post_listing_pageable && !is_archive() && !is_search() ) //Unreachable code: $post_listing_pageable is undefined, Similar code in upload.php @@ -83,7 +95,7 @@ if ( is_single() ) { $h2_cat = isset($_GET['cat']) && $_GET['cat'] ? ' ' . sprintf( __('in “%s”'), single_cat_title('', false) ) : ''; $h2_tag = isset($_GET['tag']) && $_GET['tag'] ? ' ' . sprintf( __('tagged with “%s”'), single_tag_title('', false) ) : ''; $h2_month = isset($_GET['m']) && $_GET['m'] ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : ''; - 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 ); + printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s (Add New)|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, 'post-new.php' ); } ?> @@ -129,6 +141,13 @@ endif;

      + + +
        +
      • >
      • +
      • >
      • +
      +
      - + + - - + comment_ID, 'detail', false, false ); + _wp_comment_row( $comment->comment_ID, 'single', false, false ); ?> diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 28196f4db..a3b784625 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -343,14 +343,14 @@ function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) { function wp_manage_posts_columns() { $posts_columns = array(); $posts_columns['cb'] = ''; + $posts_columns['title'] = __('Title'); if ( isset($_GET['post_status']) && 'draft' === $_GET['post_status'] ) $posts_columns['modified'] = __('Modified'); elseif ( isset($_GET['post_status']) && 'pending' === $_GET['post_status'] ) $posts_columns['modified'] = __('Submitted'); else $posts_columns['date'] = __('Date'); - $posts_columns['title'] = __('Title'); - $posts_columns['author'] = __('Author'); + //$posts_columns['author'] = __('Author'); $posts_columns['categories'] = __('Categories'); $posts_columns['tags'] = __('Tags'); if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) @@ -367,11 +367,12 @@ function wp_manage_media_columns() { $posts_columns['cb'] = ''; $posts_columns['icon'] = ''; $posts_columns['media'] = _c('Media|media column header'); - $posts_columns['desc'] = _c('Description|media column header'); + $posts_columns['tags'] = _c('Tags|media column header'); +// $posts_columns['desc'] = _c('Description|media column header'); $posts_columns['date'] = _c('Date Added|media column header'); $posts_columns['parent'] = _c('Appears with|media column header'); $posts_columns['comments'] = '
      Comments
      '; - $posts_columns['location'] = _c('Location|media column header'); +// $posts_columns['actions'] = _c('Actions|media column header'); $posts_columns = apply_filters('manage_media_columns', $posts_columns); return $posts_columns; @@ -741,18 +742,12 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true $post = get_post($comment->comment_post_ID); $authordata = get_userdata($post->post_author); $the_comment_status = wp_get_comment_status($comment->comment_ID); - $class = ('unapproved' == $the_comment_status) ? 'unapproved' : ''; if ( current_user_can( 'edit_post', $post->ID ) ) { $post_link = ""; - $post_link .= get_the_title($comment->comment_post_ID) . ''; - - $edit_link_start = ""; - $edit_link_end = ''; } else { $post_link = get_the_title($comment->comment_post_ID); - $edit_link_start = $edit_link_end =''; } $author_url = get_comment_author_url(); @@ -774,52 +769,63 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true $spam_url = clean_url( wp_nonce_url( "comment.php?action=deletecomment&dt=spam&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) ); ?> - + comment_post_ID) ) { ?> - -


      - - | - - ID ) ) : ?> - comment_author_email) ): ?> - | - - - -

      - -

      - - - + + + comment_post_ID) ) { $actions['approve'] = "" . __( 'Approve' ) . ' | '; $actions['unapprove'] = "" . __( 'Unapprove' ) . ' | '; - - // we're looking at list of only approved or only unapproved comments - if ( 'moderated' == $comment_status ) { - $actions['approve'] = "" . __( 'Approve' ) . ' | '; - unset($actions['unapprove']); - } elseif ( 'approved' == $comment_status ) { - $actions['unapprove'] = "" . __( 'Unapprove' ) . ' | '; - unset($actions['approve']); - } - + $actions['edit'] = "". __('Edit') . ' | '; + $actions['flag'] = "Flag for Follow-up | "; $actions['spam'] = "" . __( 'Spam' ) . ' | '; $actions['delete'] = "" . __('Delete') . ''; + + if ( $comment_status ) { // not looking at all comments + if ( 'approved' == $the_comment_status ) { + $actions['unapprove'] = "" . __( 'Unapprove' ) . ' | '; + unset($actions['approve']); + } else { + $actions['approve'] = "" . __( 'Approve' ) . ' | '; + unset($actions['unapprove']); + } + } + + if ( 'spam' == $the_comment_status ) + unset($actions['spam']); + $actions = apply_filters( 'comment_row_actions', $actions, $comment ); + foreach ( $actions as $action => $link ) echo "$link"; } ?> + + +
      + +
      + + ID ) ) : ?> + comment_author_email) ): ?> +
      + + + + + + + "" comment_count); ?>
      + + + '; $hour = ''; $minute = ''; - printf(_c('%1$s%2$s, %3$s
      @ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute); + printf(_c('%1$s%2$s, %3$s @ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute); echo "\n\n"; foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) echo '' . "\n"; ?> + + + $id, 'title' => $title, 'callback' => $callback); } +// crazyhorse - this can be made simpler function do_meta_boxes($page, $context, $object) { global $wp_meta_boxes; + static $already_sorted = false; do_action('do_meta_boxes', $page, $context, $object); - if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) ) - return; + echo "
      \n"; - foreach ( array('high', 'core', 'default', 'low') as $priority ) { - if ( ! isset( $wp_meta_boxes[$page][$context][$priority] ) ) - continue; - - foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) { - if ( false === $box ) - continue; - echo '
      ' . "\n"; - echo "

      {$box['title']}

      \n"; - echo '
      ' . "\n"; - call_user_func($box['callback'], $object, $box); - echo "
      \n"; - echo "
      \n"; + $i = 0; + do { + // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose + if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) { + foreach ( $sorted as $box_context => $ids ) + foreach ( explode(',', $ids) as $id ) + if ( $id ) + add_meta_box( $id, null, null, $page, $box_context, 'sorted' ); } - } + $already_sorted = true; + + if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) ) + break; + + + foreach ( array('high', 'sorted', 'core', 'default', 'low') as $priority ) { + foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) { + if ( false == $box || ! $box['title'] ) + continue; + $i++; + echo '
      ' . "\n"; + echo "

      {$box['title']}

      \n"; + echo '
      ' . "\n"; + call_user_func($box['callback'], $object, $box); + echo "
      \n"; + echo "
      \n"; + } + } + } while(0); + + echo "
      "; + + return $i; + } /** diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index 9e3b953dd..fe7c12390 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -10,22 +10,24 @@ require_once ('admin.php'); // Handle bulk deletes -if ( isset($_GET['deleteit']) && isset($_GET['linkcheck']) ) { +if ( isset($_GET['action']) && isset($_GET['linkcheck']) ) { check_admin_referer('bulk-bookmarks'); if ( ! current_user_can('manage_links') ) wp_die( __('You do not have sufficient permissions to edit the links for this blog.') ); + + if ( $_GET['action'] == 'delete' ) { + foreach ( (array) $_GET['linkcheck'] as $link_id) { + $link_id = (int) $link_id; - foreach ( (array) $_GET['linkcheck'] as $link_id) { - $link_id = (int) $link_id; + wp_delete_link($link_id); + } - wp_delete_link($link_id); + $sendback = wp_get_referer(); + $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); + wp_redirect($sendback); + exit; } - - $sendback = wp_get_referer(); - $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); - wp_redirect($sendback); - exit; } elseif ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; @@ -82,7 +84,7 @@ if ( isset($_GET['deleted']) ) {
      -

      add new)' ), 'link-add.php' ); ?>

      +

      Add New)' ), 'link-add.php' ); ?>

      @@ -95,7 +97,11 @@ if ( isset($_GET['deleted']) ) {

      - + + \n"; diff --git a/wp-admin/upload.php b/wp-admin/upload.php index 06cedc7d3..6557fff6e 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -8,34 +8,38 @@ /** WordPress Administration Bootstrap */ require_once('admin.php'); +add_thickbox(); +wp_enqueue_script('media-upload'); if (!current_user_can('upload_files')) wp_die(__('You do not have permission to upload files.')); // Handle bulk deletes -if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) { +if ( isset($_GET['action']) && isset($_GET['media']) ) { check_admin_referer('bulk-media'); - foreach( (array) $_GET['delete'] as $post_id_del ) { - $post_del = & get_post($post_id_del); + if ( $_GET['action'] == 'delete' ) { + foreach( (array) $_GET['media'] as $post_id_del ) { + $post_del = & get_post($post_id_del); - if ( !current_user_can('delete_post', $post_id_del) ) - wp_die( __('You are not allowed to delete this post.') ); + if ( !current_user_can('delete_post', $post_id_del) ) + wp_die( __('You are not allowed to delete this post.') ); - if ( $post_del->post_type == 'attachment' ) - if ( ! wp_delete_attachment($post_id_del) ) - wp_die( __('Error in deleting...') ); + if ( $post_del->post_type == 'attachment' ) + if ( ! wp_delete_attachment($post_id_del) ) + wp_die( __('Error in deleting...') ); + } + + $location = 'upload.php'; + if ( $referer = wp_get_referer() ) { + if ( false !== strpos($referer, 'upload.php') ) + $location = $referer; + } + + $location = add_query_arg('message', 2, $location); + $location = remove_query_arg('posted', $location); + wp_redirect($location); + exit; } - - $location = 'upload.php'; - if ( $referer = wp_get_referer() ) { - if ( false !== strpos($referer, 'upload.php') ) - $location = $referer; - } - - $location = add_query_arg('message', 2, $location); - $location = remove_query_arg('posted', $location); - wp_redirect($location); - exit; } elseif ( !empty($_GET['_wp_http_referer']) ) { wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); exit; @@ -64,7 +68,7 @@ if ( !isset( $_GET['paged'] ) ) if ( is_singular() ) { printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title)); } else { - $post_mime_type_label = _c('Manage Media|manage media header'); + $post_mime_type_label = _c('Media|manage media header'); if ( isset($_GET['post_mime_type']) && in_array( $_GET['post_mime_type'], array_keys($post_mime_types) ) ) $post_mime_type_label = $post_mime_types[$_GET['post_mime_type']][1]; if ( $post_listing_pageable && !is_archive() && !is_search() ) @@ -86,7 +90,7 @@ if ( is_singular() ) { $h2_cat = isset($_GET['cat']) && $_GET['cat'] ? ' ' . sprintf( __('in “%s”'), single_cat_title('', false) ) : ''; $h2_tag = isset($_GET['tag']) && $_GET['tag'] ? ' ' . sprintf( __('tagged with “%s”'), single_tag_title('', false) ) : ''; $h2_month = isset($_GET['m']) && $_GET['m'] ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : ''; - 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 ); + printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s (Add New)|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' ); } ?> @@ -155,7 +159,11 @@ if ( $page_links ) ?>
      - + +