WordPress.org

Make WordPress Core

Changeset 7537


Ignore:
Timestamp:
03/26/2008 10:21:01 PM (12 years ago)
Author:
ryan
Message:

Fix redirects after editing and deleting link categories.

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-link-categories.php

    r7484 r7537  
    1919    }
    2020
    21     wp_redirect('edit-link-categories.php?message=6');
     21    $location = 'edit-link-categories.php';
     22    if ( $referer = wp_get_referer() ) {
     23        if ( false !== strpos($referer, 'edit-link-categories.php') )
     24            $location = $referer;
     25    }
     26
     27    $location = add_query_arg('message', 6, $location);
     28    wp_redirect($location);
    2229    exit();
    2330} elseif ( !empty($_GET['_wp_http_referer']) ) {
  • trunk/wp-admin/edit-link-category-form.php

    r7384 r7537  
    2323<input type="hidden" name="action" value="<?php echo $action ?>" />
    2424<input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
    25 <?php wp_nonce_field($nonce_action); ?>
     25<?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?>
    2626    <table class="form-table">
    2727        <tr class="form-field form-required">
  • trunk/wp-admin/link-category.php

    r7392 r7537  
    3636    wp_delete_term($cat_ID, 'link_category');
    3737
    38     wp_redirect('edit-link-categories.php?message=2');
     38    $location = 'edit-link-categories.php';
     39    if ( $referer = wp_get_original_referer() ) {
     40        if ( false !== strpos($referer, 'edit-link-categories.php') )
     41            $location = $referer;
     42    }
     43
     44    $location = add_query_arg('message', 2, $location);
     45
     46    wp_redirect($location);
    3947    exit;
    4048
     
    6068        wp_die(__('Cheatin&#8217; uh?'));
    6169
     70    $location = 'edit-link-categories.php';
     71    if ( $referer = wp_get_original_referer() ) {
     72        if ( false !== strpos($referer, 'edit-link-categories.php') )
     73            $location = $referer;
     74    }
     75
    6276    if ( wp_update_term($cat_ID, 'link_category', $_POST) )
    63         wp_redirect('edit-link-categories.php?message=3');
     77        $location = add_query_arg('message', 3, $location);
    6478    else
    65         wp_redirect('edit-link-categories.php?message=5');
     79        $location = add_query_arg('message', 5, $location);
    6680
     81    wp_redirect($location);
    6782    exit;
    6883break;
Note: See TracChangeset for help on using the changeset viewer.