-if ( !current_user_can($tax->cap->edit_terms) )
- wp_die( __('You are not allowed to edit this item.') );
-
-$messages = array();
-$messages['_item'] = array(
- 0 => '', // Unused. Messages start at index 1.
- 1 => __( 'Item added.' ),
- 2 => __( 'Item deleted.' ),
- 3 => __( 'Item updated.' ),
- 4 => __( 'Item not added.' ),
- 5 => __( 'Item not updated.' ),
- 6 => __( 'Items deleted.' )
-);
-$messages['category'] = array(
- 0 => '', // Unused. Messages start at index 1.
- 1 => __( 'Category added.' ),
- 2 => __( 'Category deleted.' ),
- 3 => __( 'Category updated.' ),
- 4 => __( 'Category not added.' ),
- 5 => __( 'Category not updated.' ),
- 6 => __( 'Categories deleted.' )
-);
-$messages['post_tag'] = array(
- 0 => '', // Unused. Messages start at index 1.
- 1 => __( 'Tag added.' ),
- 2 => __( 'Tag deleted.' ),
- 3 => __( 'Tag updated.' ),
- 4 => __( 'Tag not added.' ),
- 5 => __( 'Tag not updated.' ),
- 6 => __( 'Tags deleted.' )
-);
-
-$messages = apply_filters( 'term_updated_messages', $messages );
-
-$message = false;
-if ( isset( $_REQUEST['message'] ) && ( $msg = (int) $_REQUEST['message'] ) ) {
- if ( isset( $messages[ $taxonomy ][ $msg ] ) )
- $message = $messages[ $taxonomy ][ $msg ];
- elseif ( ! isset( $messages[ $taxonomy ] ) && isset( $messages['_item'][ $msg ] ) )
- $message = $messages['_item'][ $msg ];
+if ( ! current_user_can( $tax->cap->edit_terms ) ) {
+ wp_die(
+ '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' .
+ '<p>' . __( 'You are not allowed to edit this item.' ) . '</p>',
+ 403
+ );
+}
+
+/** Also used by the Edit Tag form */
+require_once( ABSPATH . 'wp-admin/includes/edit-tag-messages.php' );
+
+$class = ( isset( $_REQUEST['error'] ) ) ? 'error' : 'updated';
+
+if ( is_plugin_active( 'wpcat2tag-importer/wpcat2tag-importer.php' ) ) {
+ $import_link = admin_url( 'admin.php?import=wpcat2tag' );
+} else {
+ $import_link = admin_url( 'import.php' );