Changeset 3215845
- Timestamp:
- 01/02/2025 07:51:16 AM (12 months ago)
- Location:
- term-taxonomy-converter/trunk
- Files:
-
- 2 edited
-
readme.md (modified) (1 diff)
-
term-taxonomy-converter.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
term-taxonomy-converter/trunk/readme.md
r2923010 r3215845 4 4 Tags: importer, converter, copy, duplicate, categories and tags converter, taxonomy converter, copy taxonomies, duplicate taxonomies, terms 5 5 Requires at least: 3.0 6 Tested up to: 6. 2.27 Stable tag: 1.2 6 Tested up to: 6.7.1 7 Stable tag: 1.2.1 8 8 License: GPLv3 or later 9 9 License URI: <a href="http://www.gnu.org/licenses/gpl-3.0.html">http://www.gnu.org/licenses/gpl-3.0.html</a> -
term-taxonomy-converter/trunk/term-taxonomy-converter.php
r2923010 r3215845 11 11 * Description: Copy or convert terms between taxonomies. This plugin, allows you to copy (duplicate) or convert (move) terms from one taxonomy to another or to multiple taxonomies, while maintaining associated posts. 12 12 * Tags: importer, converter, copy, duplicate, categories and tags converter, taxonomy converter, copy taxonomies, duplicate taxonomies, terms 13 * Version: 1.2 13 * Version: 1.2.1 14 14 * Author: Dhanendran 15 15 * Author URI: http://dhanendranrajagopal.me/ … … 32 32 public $all_terms = array(); 33 33 public $hybrids_ids = array(); 34 public $terms_to_convert = array(); 34 35 35 36 function __construct() { … … 87 88 public function page() { 88 89 $tax = ( isset( $_GET['tax'] ) ) ? sanitize_text_field( $_GET['tax'] ) : 'category'; 90 // Validate that the taxonomy exists 91 if ( ! taxonomy_exists( $tax ) ) { 92 $tax = 'category'; // Fallback to default if invalid 93 } 89 94 $step = ( isset( $_GET['step'] ) ) ? (int) sanitize_text_field( $_GET['step'] ) : 1; 90 95 … … 226 231 227 232 if ( 228 ( ! isset( $_POST['terms_to_convert' ] ) || ! is_array( $_POST['terms_to_convert'] ) )229 && empty( $this->terms_to_convert ) || ( ! isset( $_POST['taxes'] ) )230 ) { ?>231 <div class="narrow">232 <p><?php printf( __( 'Uh, oh. Something didn’t work. Please <a href="%s">try again</a>.', 'd9_ttc' ), esc_attr( 'tools.php?page=term_tax_converter&tax=' . $tax ) ); ?></p>233 </div>233 ( ! isset( $_POST['terms_to_convert' ] ) || ! is_array( $_POST['terms_to_convert'] ) ) 234 && empty( $this->terms_to_convert ) || ( ! isset( $_POST['taxes'] ) ) 235 ) { ?> 236 <div class="narrow"> 237 <p><?php printf( __( 'Uh, oh. Something didn’t work. Please <a href="%s">try again</a>.', 'd9_ttc' ), esc_attr( 'tools.php?page=term_tax_converter&tax=' . $tax ) ); ?></p> 238 </div> 234 239 <?php 235 return;240 return; 236 241 } 237 242 238 243 if ( empty( $this->terms_to_convert ) ) 239 $this->terms_to_convert = filter_input( INPUT_POST, 'terms_to_convert', FILTER_ SANITIZE_STRING, FILTER_REQUIRE_ARRAY );244 $this->terms_to_convert = filter_input( INPUT_POST, 'terms_to_convert', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); 240 245 241 246 $taxonomy = $this->taxes[ $tax ]; … … 247 252 $c_label = 'Copy'; 248 253 249 $new_taxes = filter_input( INPUT_POST, 'taxes', FILTER_ SANITIZE_STRING, FILTER_REQUIRE_ARRAY );254 $new_taxes = filter_input( INPUT_POST, 'taxes', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY ); 250 255 251 256 $hybrid_cats = $clear_parents = $parents = false; … … 300 305 if ( ! $convert ) { 301 306 $hybrid_cats = true; 302 echo '*';307 echo '*'; 303 308 } 304 309 $clean_term_cache[] = $term->term_id;
Note: See TracChangeset
for help on using the changeset viewer.