Changeset 3077810
- Timestamp:
- 04/26/2024 07:44:45 PM (2 years ago)
- Location:
- bulk-term-generator
- Files:
-
- 10 edited
- 1 copied
-
tags/1.4.0 (copied) (copied from bulk-term-generator/trunk)
-
tags/1.4.0/README.txt (modified) (4 diffs)
-
tags/1.4.0/bulk-term-generator.php (modified) (2 diffs)
-
tags/1.4.0/classes/class-bulk-term-generator-admin.php (modified) (3 diffs)
-
tags/1.4.0/classes/class-bulk-term-generator-template.php (modified) (9 diffs)
-
tags/1.4.0/classes/class-bulk-term-generator.php (modified) (1 diff)
-
trunk/README.txt (modified) (4 diffs)
-
trunk/bulk-term-generator.php (modified) (2 diffs)
-
trunk/classes/class-bulk-term-generator-admin.php (modified) (3 diffs)
-
trunk/classes/class-bulk-term-generator-template.php (modified) (9 diffs)
-
trunk/classes/class-bulk-term-generator.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bulk-term-generator/tags/1.4.0/README.txt
r3000719 r3077810 3 3 Tags: add multiple terms,bulk import,terms,tags,categories,taxonomy,add,multiple,mass,keywords,taxonomies,generate 4 4 Requires at least: 3.1 5 Tested up to: 6. 25 Tested up to: 6.5.2 6 6 Stable tag: trunk 7 7 License: GPLv2 or later … … 16 16 Bulk Term Generator allows you to seamlessly import multiple terms to your selected taxonomies in WordPress. Its powerful yet easy-to-use interface lets you copy and paste your terms, queue them up, and even select a parent term for hierarchy. No need for pre-formatted CSV files or meticulous manual entry. You can even specify the slug and description for each term, making your content even more search-friendly. 17 17 18 But the magic doesn ’t stop there. Bulk Term Generator gives you total control before you import your terms. With its unique 'Preview' feature, you can see exactly how your terms will be added and make any necessary changes before hitting the final "Generate Terms" button. Plus, you can edit or delete any queued term at any point with just a click.18 But the magic doesn't stop there. Bulk Term Generator gives you total control before you import your terms. With its unique 'Preview' feature, you can see exactly how your terms will be added and make any necessary changes before hitting the final "Generate Terms" button. Plus, you can edit or delete any queued term at any point with just a click. 19 19 20 20 Bulk Term Generator has been lauded as a 'lifesaver' and a 'developer's dream' by our users, and we are confident you will think the same: … … 24 24 > "Recently used this for a client to import 43 terms in multiple hierarchical levels. So much quicker than going about it individually." - Brian Fischer 25 25 --- 26 > "I tried a few other plugins to bulk add taxonomy terms but none of them were intuitive. This plugin is the only one that you ’ll ever need. It does everything I expected and more!" - Andrew Schultz26 > "I tried a few other plugins to bulk add taxonomy terms but none of them were intuitive. This plugin is the only one that you'll ever need. It does everything I expected and more!" - Andrew Schultz 27 27 28 28 Bulk Term Generator supports both English and Spanish, and we're planning to add more languages in the future. Plus, it's 100% free. No hidden costs or premium versions. … … 71 71 == Changelog == 72 72 73 = 1.4.0 = 74 * Tested with WordPress 6.5.2 75 * Improved coding standards 76 * Added a blank option to parent select field 77 * Refactored get_terms usage to align with updated WordPress standards 78 73 79 = 1.3.3 = 74 80 * Shortened the plugin name in the admin -
bulk-term-generator/tags/1.4.0/bulk-term-generator.php
r3000434 r3077810 13 13 * Plugin URI: http://nateallen.com/wordpress-plugins/bulk-term-generator 14 14 * Description: Streamline taxonomy management in WordPress with Bulk Term Generator, your free tool for easy, bulk term importing. 15 * Version: 1. 3.315 * Version: 1.4.0 16 16 * Requires at least: 3.1 17 * Tested up to: 6. 4.117 * Tested up to: 6.5.2 18 18 * Requires PHP: 7.4 19 19 * Author: Nate Allen 20 * Author URI: http ://nateallen.com/20 * Author URI: https://nateallen.com/ 21 21 * License: GPL-2.0+ 22 22 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 42 42 spl_autoload_register( 'bulk_term_generator_autoloader' ); 43 43 44 function bulk_term_generator_autoloader( $class ) {45 $class = strtolower( str_replace( '_', '-', $class) );44 function bulk_term_generator_autoloader( $class_name ) { 45 $class_name = strtolower( str_replace( '_', '-', $class_name ) ); 46 46 47 47 // If it's not one of my classes, ignore it 48 if ( substr( $class , 0, 19 ) !== 'bulk-term-generator' ) {48 if ( substr( $class_name, 0, 19 ) !== 'bulk-term-generator' ) { 49 49 return false; 50 50 } 51 51 52 52 // Check if the file exists, and if it does, include it 53 if ( file_exists( plugin_dir_path( __FILE__ ) . 'classes/class-' . $class . '.php' ) ) {54 include plugin_dir_path( __FILE__ ) . 'classes/class-' . $class . '.php';53 if ( file_exists( plugin_dir_path( __FILE__ ) . 'classes/class-' . $class_name . '.php' ) ) { 54 include plugin_dir_path( __FILE__ ) . 'classes/class-' . $class_name . '.php'; 55 55 } 56 56 } -
bulk-term-generator/tags/1.4.0/classes/class-bulk-term-generator-admin.php
r3000434 r3077810 111 111 $taxonomy_slug = $_GET['taxonomy']; // phpcs:ignore WordPress.Security.NonceVerification 112 112 $taxonomy_name = $taxonomy->labels->name; 113 $taxonomy_terms = get_terms( $_GET['taxonomy'], array( 'hide_empty' => false ) ); // phpcs:ignore WordPress.Security.NonceVerification 113 $taxonomy_terms = get_terms( 114 array( 115 'hide_empty' => false, 116 'taxonomy' => $_GET['taxonomy'], // phpcs:ignore WordPress.Security.NonceVerification 117 ) 118 ); 114 119 115 120 $this->data['is_hierarchical'] = $taxonomy->hierarchical; … … 280 285 'btg_terms_list' => $json_list, 281 286 'admin_url' => admin_url( 'admin-ajax.php' ), 282 'plugin_dir' => plugins_url( '', dirname( __FILE__ )),287 'plugin_dir' => plugins_url( '', __DIR__ ), 283 288 'taxonomy' => $taxonomy, 284 289 'i18n' => array( … … 307 312 echo $template->render(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 308 313 } 309 310 314 } -
bulk-term-generator/tags/1.4.0/classes/class-bulk-term-generator-template.php
r2932813 r3077810 168 168 169 169 return $html; 170 171 170 } 172 171 … … 192 191 // Get all of the terms for the given taxonomy 193 192 $terms = get_terms( 194 $options['taxonomy'],195 193 array( 196 194 'hide_empty' => false, 197 195 'parent' => 0, 196 'taxonomy' => $options['taxonomy'], 198 197 ) 199 198 ); … … 203 202 204 203 // Reset the selection options variable 205 $this->select_options = ' ';204 $this->select_options = '<option value=""></option>'; 206 205 207 206 foreach ( $terms as $term ) { … … 214 213 215 214 return $html; 216 217 215 } 218 216 … … 240 238 // Get all of the terms for the given taxonomy. 241 239 $terms = get_terms( 242 $options['taxonomy'],243 240 array( 244 241 'hide_empty' => false, 245 242 'parent' => 0, 243 'taxonomy' => $options['taxonomy'], 246 244 ) 247 245 ); … … 275 273 // Get all of the terms for the given taxonomy. 276 274 $terms = get_terms( 277 $taxonomy,278 275 array( 279 276 'hide_empty' => false, 280 277 'parent' => 0, 278 'taxonomy' => $taxonomy, 281 279 ) 282 280 ); … … 323 321 */ 324 322 private function get_select_options( string $taxonomy, object $term ) { 325 $this->select_options .= '<option value="' . $term->term_id . '" data-parent="' . $term->parent . '" data-name="' . $term->name . '">' . $this->get_separators( $term->term_id, $taxonomy ) . $term->name . '</option>'; 323 $this->select_options .= sprintf( 324 '<option value="%s" data-parent="%s" data-name="%s">%s%s</option>', 325 $term->term_id, 326 $term->parent, 327 htmlspecialchars( $term->name, ENT_QUOTES, 'UTF-8' ), 328 $this->get_separators( $term->term_id, $taxonomy ), 329 htmlspecialchars( $term->name, ENT_QUOTES, 'UTF-8' ) 330 ); 326 331 327 332 $children = get_terms( 328 $taxonomy,329 333 array( 330 334 'parent' => $term->term_id, 331 335 'hide_empty' => '0', 336 'taxonomy' => $taxonomy, 332 337 ) 333 338 ); … … 352 357 private function get_list_items( string $taxonomy, object $term, $ul ) { 353 358 $children = get_terms( 354 $taxonomy,355 359 array( 356 360 'parent' => $term->term_id, 357 361 'hide_empty' => '0', 362 'taxonomy' => $taxonomy, 358 363 ) 359 364 ); … … 385 390 // Get all of the terms for the given taxonomy. 386 391 $children = get_terms( 387 $taxonomy,388 392 array( 389 393 'hide_empty' => false, 390 394 'parent' => $term->term_id, 395 'taxonomy' => $taxonomy, 391 396 ) 392 397 ); -
bulk-term-generator/tags/1.4.0/classes/class-bulk-term-generator.php
r3000434 r3077810 63 63 */ 64 64 private function load_dependencies() { 65 66 65 $this->loader = new Bulk_Term_Generator_Loader(); 67 68 66 } 69 67 -
bulk-term-generator/trunk/README.txt
r3000719 r3077810 3 3 Tags: add multiple terms,bulk import,terms,tags,categories,taxonomy,add,multiple,mass,keywords,taxonomies,generate 4 4 Requires at least: 3.1 5 Tested up to: 6. 25 Tested up to: 6.5.2 6 6 Stable tag: trunk 7 7 License: GPLv2 or later … … 16 16 Bulk Term Generator allows you to seamlessly import multiple terms to your selected taxonomies in WordPress. Its powerful yet easy-to-use interface lets you copy and paste your terms, queue them up, and even select a parent term for hierarchy. No need for pre-formatted CSV files or meticulous manual entry. You can even specify the slug and description for each term, making your content even more search-friendly. 17 17 18 But the magic doesn ’t stop there. Bulk Term Generator gives you total control before you import your terms. With its unique 'Preview' feature, you can see exactly how your terms will be added and make any necessary changes before hitting the final "Generate Terms" button. Plus, you can edit or delete any queued term at any point with just a click.18 But the magic doesn't stop there. Bulk Term Generator gives you total control before you import your terms. With its unique 'Preview' feature, you can see exactly how your terms will be added and make any necessary changes before hitting the final "Generate Terms" button. Plus, you can edit or delete any queued term at any point with just a click. 19 19 20 20 Bulk Term Generator has been lauded as a 'lifesaver' and a 'developer's dream' by our users, and we are confident you will think the same: … … 24 24 > "Recently used this for a client to import 43 terms in multiple hierarchical levels. So much quicker than going about it individually." - Brian Fischer 25 25 --- 26 > "I tried a few other plugins to bulk add taxonomy terms but none of them were intuitive. This plugin is the only one that you ’ll ever need. It does everything I expected and more!" - Andrew Schultz26 > "I tried a few other plugins to bulk add taxonomy terms but none of them were intuitive. This plugin is the only one that you'll ever need. It does everything I expected and more!" - Andrew Schultz 27 27 28 28 Bulk Term Generator supports both English and Spanish, and we're planning to add more languages in the future. Plus, it's 100% free. No hidden costs or premium versions. … … 71 71 == Changelog == 72 72 73 = 1.4.0 = 74 * Tested with WordPress 6.5.2 75 * Improved coding standards 76 * Added a blank option to parent select field 77 * Refactored get_terms usage to align with updated WordPress standards 78 73 79 = 1.3.3 = 74 80 * Shortened the plugin name in the admin -
bulk-term-generator/trunk/bulk-term-generator.php
r3000434 r3077810 13 13 * Plugin URI: http://nateallen.com/wordpress-plugins/bulk-term-generator 14 14 * Description: Streamline taxonomy management in WordPress with Bulk Term Generator, your free tool for easy, bulk term importing. 15 * Version: 1. 3.315 * Version: 1.4.0 16 16 * Requires at least: 3.1 17 * Tested up to: 6. 4.117 * Tested up to: 6.5.2 18 18 * Requires PHP: 7.4 19 19 * Author: Nate Allen 20 * Author URI: http ://nateallen.com/20 * Author URI: https://nateallen.com/ 21 21 * License: GPL-2.0+ 22 22 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 42 42 spl_autoload_register( 'bulk_term_generator_autoloader' ); 43 43 44 function bulk_term_generator_autoloader( $class ) {45 $class = strtolower( str_replace( '_', '-', $class) );44 function bulk_term_generator_autoloader( $class_name ) { 45 $class_name = strtolower( str_replace( '_', '-', $class_name ) ); 46 46 47 47 // If it's not one of my classes, ignore it 48 if ( substr( $class , 0, 19 ) !== 'bulk-term-generator' ) {48 if ( substr( $class_name, 0, 19 ) !== 'bulk-term-generator' ) { 49 49 return false; 50 50 } 51 51 52 52 // Check if the file exists, and if it does, include it 53 if ( file_exists( plugin_dir_path( __FILE__ ) . 'classes/class-' . $class . '.php' ) ) {54 include plugin_dir_path( __FILE__ ) . 'classes/class-' . $class . '.php';53 if ( file_exists( plugin_dir_path( __FILE__ ) . 'classes/class-' . $class_name . '.php' ) ) { 54 include plugin_dir_path( __FILE__ ) . 'classes/class-' . $class_name . '.php'; 55 55 } 56 56 } -
bulk-term-generator/trunk/classes/class-bulk-term-generator-admin.php
r3000434 r3077810 111 111 $taxonomy_slug = $_GET['taxonomy']; // phpcs:ignore WordPress.Security.NonceVerification 112 112 $taxonomy_name = $taxonomy->labels->name; 113 $taxonomy_terms = get_terms( $_GET['taxonomy'], array( 'hide_empty' => false ) ); // phpcs:ignore WordPress.Security.NonceVerification 113 $taxonomy_terms = get_terms( 114 array( 115 'hide_empty' => false, 116 'taxonomy' => $_GET['taxonomy'], // phpcs:ignore WordPress.Security.NonceVerification 117 ) 118 ); 114 119 115 120 $this->data['is_hierarchical'] = $taxonomy->hierarchical; … … 280 285 'btg_terms_list' => $json_list, 281 286 'admin_url' => admin_url( 'admin-ajax.php' ), 282 'plugin_dir' => plugins_url( '', dirname( __FILE__ )),287 'plugin_dir' => plugins_url( '', __DIR__ ), 283 288 'taxonomy' => $taxonomy, 284 289 'i18n' => array( … … 307 312 echo $template->render(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 308 313 } 309 310 314 } -
bulk-term-generator/trunk/classes/class-bulk-term-generator-template.php
r2932813 r3077810 168 168 169 169 return $html; 170 171 170 } 172 171 … … 192 191 // Get all of the terms for the given taxonomy 193 192 $terms = get_terms( 194 $options['taxonomy'],195 193 array( 196 194 'hide_empty' => false, 197 195 'parent' => 0, 196 'taxonomy' => $options['taxonomy'], 198 197 ) 199 198 ); … … 203 202 204 203 // Reset the selection options variable 205 $this->select_options = ' ';204 $this->select_options = '<option value=""></option>'; 206 205 207 206 foreach ( $terms as $term ) { … … 214 213 215 214 return $html; 216 217 215 } 218 216 … … 240 238 // Get all of the terms for the given taxonomy. 241 239 $terms = get_terms( 242 $options['taxonomy'],243 240 array( 244 241 'hide_empty' => false, 245 242 'parent' => 0, 243 'taxonomy' => $options['taxonomy'], 246 244 ) 247 245 ); … … 275 273 // Get all of the terms for the given taxonomy. 276 274 $terms = get_terms( 277 $taxonomy,278 275 array( 279 276 'hide_empty' => false, 280 277 'parent' => 0, 278 'taxonomy' => $taxonomy, 281 279 ) 282 280 ); … … 323 321 */ 324 322 private function get_select_options( string $taxonomy, object $term ) { 325 $this->select_options .= '<option value="' . $term->term_id . '" data-parent="' . $term->parent . '" data-name="' . $term->name . '">' . $this->get_separators( $term->term_id, $taxonomy ) . $term->name . '</option>'; 323 $this->select_options .= sprintf( 324 '<option value="%s" data-parent="%s" data-name="%s">%s%s</option>', 325 $term->term_id, 326 $term->parent, 327 htmlspecialchars( $term->name, ENT_QUOTES, 'UTF-8' ), 328 $this->get_separators( $term->term_id, $taxonomy ), 329 htmlspecialchars( $term->name, ENT_QUOTES, 'UTF-8' ) 330 ); 326 331 327 332 $children = get_terms( 328 $taxonomy,329 333 array( 330 334 'parent' => $term->term_id, 331 335 'hide_empty' => '0', 336 'taxonomy' => $taxonomy, 332 337 ) 333 338 ); … … 352 357 private function get_list_items( string $taxonomy, object $term, $ul ) { 353 358 $children = get_terms( 354 $taxonomy,355 359 array( 356 360 'parent' => $term->term_id, 357 361 'hide_empty' => '0', 362 'taxonomy' => $taxonomy, 358 363 ) 359 364 ); … … 385 390 // Get all of the terms for the given taxonomy. 386 391 $children = get_terms( 387 $taxonomy,388 392 array( 389 393 'hide_empty' => false, 390 394 'parent' => $term->term_id, 395 'taxonomy' => $taxonomy, 391 396 ) 392 397 ); -
bulk-term-generator/trunk/classes/class-bulk-term-generator.php
r3000434 r3077810 63 63 */ 64 64 private function load_dependencies() { 65 66 65 $this->loader = new Bulk_Term_Generator_Loader(); 67 68 66 } 69 67
Note: See TracChangeset
for help on using the changeset viewer.