Ticket #5058: 5058-remove-convert-all.diff
| File 5058-remove-convert-all.diff, 2.0 KB (added by foolswisdom, 5 years ago) |
|---|
-
wp-admin/import/wp-cat2tag.php
63 63 64 64 print '</ul>'; 65 65 66 print '<p class="submit"><input type="submit" name=" maybe_convert_all_cats" value="' . __('Convert All Categories') . '" /> <input type="submit" name="submit" value="' . __('Convert »') . '" /></p>';66 print '<p class="submit"><input type="submit" name="submit" value="' . __('Convert »') . '" /></p>'; 67 67 print '</form>'; 68 68 } 69 69 … … 160 160 print '</ul>'; 161 161 } 162 162 163 function convert_all_confirm() {164 print '<div class="narrow">';165 166 print '<h3>' . __('Confirm') . '</h3>';167 168 print '<p>' . __('You are about to convert all categories to tags. Are you sure you want to continue?') . '</p>';169 170 print '<form action="admin.php?import=wp-cat2tag" method="post">';171 wp_nonce_field('import-cat2tag');172 print '<p style="text-align:center" class="submit"><input type="submit" value="' . __('Yes') . '" name="yes_convert_all_cats" /> <input type="submit" value="' . __('No') . '" name="no_dont_do_it" /></p>';173 print '</form>';174 175 print '</div>';176 }177 178 function convert_all() {179 global $wpdb;180 181 $this->populate_all_categories();182 foreach ( $this->all_categories as $category )183 $this->categories_to_convert[] = $category->term_id;184 $this->convert_them();185 }186 187 163 function init() { 188 164 189 if (isset($_POST['maybe_convert_all_cats'])) { 190 $step = 3; 191 } elseif (isset($_POST['yes_convert_all_cats'])) { 192 $step = 4; 193 } elseif (isset($_POST['no_dont_do_it'])) { 194 die('no_dont_do_it'); 195 } else { 196 $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1; 197 } 165 $step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1; 198 166 199 167 $this->header(); 200 168 … … 214 182 case 2 : 215 183 $this->convert_them(); 216 184 break; 217 218 case 3 :219 $this->convert_all_confirm();220 break;221 222 case 4 :223 $this->convert_all();224 break;225 185 } 226 186 } 227 187
