WordPress.org

Make WordPress Core

Ticket #31241: 31241.5.diff

File 31241.5.diff, 1.4 KB (added by SergeyBiryukov, 5 years ago)
  • src/wp-admin/edit-tags.php

     
    6565        if ( $ret && !is_wp_error( $ret ) )
    6666                $location = add_query_arg( 'message', 1, $location );
    6767        else
    68                 $location = add_query_arg( 'message', 4, $location );
     68                $location = add_query_arg( array( 'error' => true, 'message' => 4 ), $location );
    6969
    7070        break;
    7171
     
    156156        if ( $ret && !is_wp_error( $ret ) )
    157157                $location = add_query_arg( 'message', 3, $location );
    158158        else
    159                 $location = add_query_arg( 'message', 5, $location );
     159                $location = add_query_arg( array( 'error' => true, 'message' => 5 ), $location );
    160160        break;
    161161}
    162162
     
    297297                $message = $messages['_item'][ $msg ];
    298298}
    299299
     300$class = ( isset( $_REQUEST['error'] ) ) ? 'error' : 'updated';
    300301?>
    301302
    302303<div class="wrap nosubsub">
     
    306307</h2>
    307308
    308309<?php if ( $message ) : ?>
    309 <div id="message" class="updated"><p><?php echo $message; ?></p></div>
    310 <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
     310<div id="message" class="<?php echo esc_attr( $class ); ?>"><p><?php echo $message; ?></p></div>
     311<?php $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message', 'error' ), $_SERVER['REQUEST_URI'] );
    311312endif; ?>
    312313<div id="ajax-response"></div>
    313314