Ticket #11184: 11184-cats-tags-links-3.2.patch
| File 11184-cats-tags-links-3.2.patch, 4.4 KB (added by nacin, 3 years ago) |
|---|
-
categories.php
34 34 break; 35 35 36 36 case 'delete': 37 if ( !isset( $_GET['tag_ID'] ) ) 38 wp_redirect('categories.php?message=7'); 39 37 40 $cat_ID = (int) $_GET['cat_ID']; 38 41 check_admin_referer('delete-category_' . $cat_ID); 39 42 … … 59 62 if ( !current_user_can('manage_categories') ) 60 63 wp_die( __('You are not allowed to delete categories.') ); 61 64 62 foreach ( (array) $_GET['delete'] as $cat_ID ) { 65 $cats = $_GET['delete']; 66 foreach ( (array) $cats as $cat_ID ) { 63 67 $cat_name = get_cat_name($cat_ID); 64 68 65 69 // Don't delete the default cats. … … 69 73 wp_delete_category($cat_ID); 70 74 } 71 75 72 wp_safe_redirect( wp_get_referer() ); 76 if ( count( (array) $cats ) == 1 ) 77 wp_safe_redirect( add_query_arg( 'message', 2, wp_get_referer() ) ); 78 else 79 wp_safe_redirect( add_query_arg( 'message', 6, wp_get_referer() ) ); 73 80 exit(); 74 81 75 82 break; … … 125 132 $messages[3] = __('Category updated.'); 126 133 $messages[4] = __('Category not added.'); 127 134 $messages[5] = __('Category not updated.'); 135 $messages[6] = __('Categories deleted.'); 136 $messages[7] = __('No categories selected.'); 128 137 ?> 129 138 130 139 <div class="wrap nosubsub"> -
edit-tags.php
44 44 break; 45 45 46 46 case 'delete': 47 if ( !isset( $_GET['tag_ID'] ) ) 48 wp_redirect('edit-tags.php?message=7'); 49 47 50 $tag_ID = (int) $_GET['tag_ID']; 48 51 check_admin_referer('delete-tag_' . $tag_ID); 49 52 … … 81 84 $location = $referer; 82 85 } 83 86 84 $location = add_query_arg('message', 6, $location); 87 if ( count( (array) $tags ) == 1 ) 88 $location = add_query_arg('message', 2, $location); 89 else 90 $location = add_query_arg('message', 6, $location); 85 91 wp_redirect($location); 86 92 exit; 87 93 … … 142 148 $messages[3] = __('Tag updated.'); 143 149 $messages[4] = __('Tag not added.'); 144 150 $messages[5] = __('Tag not updated.'); 145 $messages[6] = __('Tags deleted.'); ?> 151 $messages[6] = __('Tags deleted.'); 152 $messages[7] = __('No tags selected.'); ?> 146 153 147 154 <div class="wrap nosubsub"> 148 155 <?php screen_icon(); ?> -
link-manager.php
18 18 wp_die( __('You do not have sufficient permissions to edit the links for this blog.') ); 19 19 20 20 if ( 'delete' == $doaction ) { 21 foreach ( (array) $_GET['linkcheck'] as $link_id ) { 21 $bulklinks = $_GET['linkcheck']; 22 foreach ( (array) $bulklinks as $link_id ) { 22 23 $link_id = (int) $link_id; 23 24 24 25 wp_delete_link($link_id); 25 26 } 26 27 27 wp_redirect( wp_get_referer() );28 wp_redirect( add_query_arg( 'deleted', count( (array) $bulklinks ), wp_get_referer() ) ); 28 29 exit; 29 30 } 30 31 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { -
edit-link-categories.php
18 18 wp_die(__('Cheatin’ uh?')); 19 19 20 20 if ( 'delete' == $doaction ) { 21 foreach( (array) $_GET['delete'] as $cat_ID ) { 21 $cats = $_GET['delete']; 22 foreach( (array) $cats as $cat_ID ) { 22 23 $cat_name = get_term_field('name', $cat_ID, 'link_category'); 23 24 $default_cat_id = get_option('default_link_category'); 24 25 … … 35 36 $location = $referer; 36 37 } 37 38 38 $location = add_query_arg('message', 6, $location); 39 if ( count( (array) $cats ) == 1 ) 40 $location = add_query_arg( 'message', 2, $location ); 41 else 42 $location = add_query_arg( 'message', 6, $location ); 39 43 wp_redirect($location); 40 44 exit(); 41 45 } 42 46 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { 43 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );47 wp_redirect( add_query_arg( 'message', 7, remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ) ); 44 48 exit; 45 49 } 46 50 … … 57 61 $messages[3] = __('Category updated.'); 58 62 $messages[4] = __('Category not added.'); 59 63 $messages[5] = __('Category not updated.'); 60 $messages[6] = __('Categories deleted.'); ?> 64 $messages[6] = __('Categories deleted.'); 65 $messages[7] = __('No categories selected.'); ?> 61 66 62 67 <div class="wrap nosubsub"> 63 68 <?php screen_icon(); ?>
