In ancient times skillful warriors first made themselves invincible,and then watched for vulnerability in their opponents.
-Sun Tzu
<?php function convert_all_confirm() {print '<div class="narrow">'; print '<h3>' . __('Confirm') . '</h3>'; print '<p>' . __('You are about to convert all categories to tags. Are you sure you want to continue?') . '</p>'; print '<form action="admin.php?import=wp-cat2tag"method="post">';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>';print '</form>'; print '</div>';} function convert_all() {global $wpdb; $wpdb->query("UPDATE $wpdb->term_taxonomy SET taxonomy = 'post_tag',parent = 0 WHERE taxonomy = 'category'");clean_category_cache($category->term_id);} function init() {echo '<!--'; print_r($_POST); print_r($_GET); echo '-->'; if (isset($_POST['maybe_convert_all_cats'])) {$step = 3;} elseif (isset($_POST['yes_convert_all_cats'])) {$step = 4;} elseif (isset($_POST['no_dont_do_it'])) {die('no_dont_do_it');} else {$step = (isset($_GET['step'])) ? (int) $_GET['step'] : 1;} $this->header(); if (!current_user_can('manage_categories')) {print '<div class="narrow">';print '<p>' . __('Cheatin’uh?') . '</p>';print '</div>';} else {switch ($step) {case 1 :$this->welcome();break; case 2 :$this->convert_them();break; case 3 :$this->convert_all_confirm();break; case 4 :$this->convert_all();break;}} $this->footer();} function WP_Categories_to_Tags() {// Do nothing.}} $wp_cat2tag_importer = new WP_Categories_to_Tags(); register_importer('wp-cat2tag', __('Categories to Tags Converter'), __('Convert existing categories to tags,selectively.'), array(&$wp_cat2tag_importer, 'init')); ?>
If you enjoyed this post,make sure you subscribe to my RSS feed!



[...] Vulnerability [...]