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/link-manager.php

    r8645 r8682  
    1111
    1212// Handle bulk deletes
    13 if ( isset($_GET['deleteit']) && isset($_GET['linkcheck']) ) {
     13if ( isset($_GET['action']) && isset($_GET['linkcheck']) ) {
    1414    check_admin_referer('bulk-bookmarks');
    1515
    1616    if ( ! current_user_can('manage_links') )
    1717        wp_die( __('You do not have sufficient permissions to edit the links for this blog.') );
    18 
    19     foreach ( (array) $_GET['linkcheck'] as $link_id) {
    20         $link_id = (int) $link_id;
    21 
    22         wp_delete_link($link_id);
     18   
     19    if ( $_GET['action'] == 'delete' ) {
     20        foreach ( (array) $_GET['linkcheck'] as $link_id) {
     21            $link_id = (int) $link_id;
     22
     23            wp_delete_link($link_id);
     24        }
     25
     26        $sendback = wp_get_referer();
     27        $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
     28        wp_redirect($sendback);
     29        exit;
    2330    }
    24 
    25     $sendback = wp_get_referer();
    26     $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
    27     wp_redirect($sendback);
    28     exit;
    2931} elseif ( !empty($_GET['_wp_http_referer']) ) {
    3032     wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
     
    8385
    8486<form id="posts-filter" action="" method="get">
    85 <h2><?php printf( __( 'Manage Links (<a href="%s">add new</a>)' ), 'link-add.php' ); ?></h2>
     87<h2><?php printf( __('Links (<a href="%s">Add New</a>)' ), 'link-add.php' ); ?></h2>
    8688
    8789<p id="post-search">
     
    9698
    9799<div class="alignleft">
    98 <input type="submit" value="<?php _e('Delete'); ?>" name="deleteit" class="button-secondary delete" />
     100<select name="action">
     101<option value="" selected><?php _e('Actions'); ?></option>
     102<option value="delete"><?php _e('Delete'); ?></option>
     103</select>
     104<input type="submit" value="<?php _e('Apply'); ?>" name="doaction" class="button-secondary action" />
    99105<?php
    100106$categories = get_terms('link_category', "hide_empty=1");
Note: See TracChangeset for help on using the changeset viewer.