Ticket #33670: 33670.diff
File 33670.diff, 2.5 KB (added by , 9 years ago) |
---|
-
src/wp-admin/edit-tags.php
18 18 wp_die( __( 'Invalid taxonomy' ) ); 19 19 20 20 if ( ! current_user_can( $tax->cap->manage_terms ) ) 21 wp_die( __( 'Cheatin’ uh?' ), 403 ); 21 wp_die( 22 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 23 '<p>' . __( 'You are not allowed to manage these items.' ) . '</p>', 24 403 ); 22 25 23 26 /** 24 27 * $post_type is set when the WP_Terms_List_Table instance is created … … 54 57 check_admin_referer( 'add-tag', '_wpnonce_add-tag' ); 55 58 56 59 if ( !current_user_can( $tax->cap->edit_terms ) ) 57 wp_die( __( 'Cheatin’ uh?' ), 403 ); 60 wp_die( 61 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 62 '<p>' . __( 'You are not allowed to add this item.' ) . '</p>', 63 403 ); 58 64 59 65 $ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST ); 60 66 $location = 'edit-tags.php?taxonomy=' . $taxonomy; … … 90 96 check_admin_referer( 'delete-tag_' . $tag_ID ); 91 97 92 98 if ( !current_user_can( $tax->cap->delete_terms ) ) 93 wp_die( __( 'Cheatin’ uh?' ), 403 ); 99 wp_die( 100 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 101 '<p>' . __( 'You are not allowed to delete this item.' ) . '</p>', 102 403 ); 94 103 95 104 wp_delete_term( $tag_ID, $taxonomy ); 96 105 … … 102 111 check_admin_referer( 'bulk-tags' ); 103 112 104 113 if ( !current_user_can( $tax->cap->delete_terms ) ) 105 wp_die( __( 'Cheatin’ uh?' ), 403 ); 114 wp_die( 115 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 116 '<p>' . __( 'You are not allowed to delete these items.' ) . '</p>', 117 403 ); 106 118 107 119 $tags = (array) $_REQUEST['delete_tags']; 108 120 foreach ( $tags as $tag_ID ) { … … 140 152 check_admin_referer( 'update-tag_' . $tag_ID ); 141 153 142 154 if ( !current_user_can( $tax->cap->edit_terms ) ) 143 wp_die( __( 'Cheatin’ uh?' ), 403 ); 155 wp_die( 156 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 157 '<p>' . __( 'You are not allowed to edit this item.' ) . '</p>', 158 403 ); 144 159 145 160 $tag = get_term( $tag_ID, $taxonomy ); 146 161 if ( ! $tag ) … … 253 268 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 254 269 255 270 if ( !current_user_can($tax->cap->edit_terms) ) 256 wp_die( __('You are not allowed to edit this item.') ); 271 wp_die( 272 '<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' . 273 '<p>' . __( 'You are not allowed to edit this item.' ) . '</p>', 274 403 ); 257 275 258 276 $messages = array(); 259 277 $messages['_item'] = array(