WordPress.org

Make WordPress Core

Ticket #11870: 11870b.diff

File 11870b.diff, 939 bytes (added by scribu, 8 years ago)
  • wp-admin/categories.php

     
    114114        if ( !current_user_can('manage_categories') )
    115115                wp_die(__('Cheatin’ uh?'));
    116116
    117         $location = 'categories.php';
    118         if ( $referer = wp_get_original_referer() ) {
    119                 if ( false !== strpos($referer, 'categories.php') )
    120                         $location = $referer;
    121         }
     117        $msg_nr = wp_update_category($_POST) ? 3 : 5;
    122118
    123         if ( wp_update_category($_POST) )
    124                 $location = add_query_arg('message', 3, $location);
    125         else
    126                 $location = add_query_arg('message', 5, $location);
     119        $location = $base_url = admin_url('categories.php');
     120        if ( $referer = wp_get_original_referer() )
     121                $location = $referer;
    127122
     123        if ( false !== strpos($location, $base_url) )
     124                $location = add_query_arg('message', $msg_nr, $location);
     125
    128126        wp_redirect($location);
    129127
    130128        exit;