Changeset 2500594
- Timestamp:
- 03/22/2021 02:53:28 AM (5 years ago)
- Location:
- simple-slug-translate
- Files:
-
- 4 edited
- 1 copied
-
tags/2.7.2 (copied) (copied from simple-slug-translate/trunk)
-
tags/2.7.2/readme.txt (modified) (2 diffs)
-
tags/2.7.2/simple-slug-translate.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/simple-slug-translate.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-slug-translate/tags/2.7.2/readme.txt
r2500058 r2500594 5 5 Requires at least: 4.3 6 6 Tested up to: 5.7 7 Stable tag: 2.7. 17 Stable tag: 2.7.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 110 110 == Changelog == 111 111 112 = 2.7.2 = 113 * Add taxonomy settings 114 112 115 = 2.7.1 = 113 116 * Fixed bug -
simple-slug-translate/tags/2.7.2/simple-slug-translate.php
r2500058 r2500594 4 4 * Plugin URI: https://github.com/ko31/simple-slug-translate 5 5 * Description: Simple Slug Translate can translate the post, page, category and taxonomy slugs to English automatically. 6 * Version: 2.7. 16 * Version: 2.7.2 7 7 * Author: Ko Takagi 8 8 * Author URI: https://go-sign.info … … 173 173 foreach ( $this->options['post_types'] as $enabled_post_type ) { 174 174 if ( $enabled_post_type == $post_type ) { 175 return true; 176 } 177 } 178 179 return false; 180 } 181 182 public function is_taxonomy( $taxonomy ) { 183 if ( empty( $this->options['taxonomies'] ) ) { 184 return false; 185 } 186 187 foreach ( $this->options['taxonomies'] as $enabled_taxonomy ) { 188 if ( $enabled_taxonomy == $taxonomy ) { 175 189 return true; 176 190 } … … 195 209 196 210 public function wp_insert_term_data( $data, $taxonomy, $args ) { 211 if ( ! $this->is_taxonomy( $taxonomy ) ) { 212 return $data; 213 } 214 197 215 if ( ! empty( $data ) && empty( $args['slug'] ) ) { 198 216 $slug = $this->call_translate( $data['name'] ); … … 353 371 __( 'Enabled post types', $this->text_domain ), 354 372 array( $this, 'post_types_callback' ), 373 $this->plugin_slug, 374 'permission_settings' 375 ); 376 377 add_settings_field( 378 'taxonomies', 379 __( 'Enabled taxonomies', $this->text_domain ), 380 array( $this, 'taxonomies_callback' ), 355 381 $this->plugin_slug, 356 382 'permission_settings' … … 458 484 /> 459 485 <?php echo $post_type->labels->name ?> 486 </label> 487 <?php 488 endforeach; 489 } 490 491 public function taxonomies_callback() { 492 $taxonomies = get_taxonomies( array( 493 'show_ui' => true 494 ), 'objects' ); 495 foreach ( $taxonomies as $taxonomy ) : 496 ?> 497 <label> 498 <input 499 type="checkbox" 500 name="<?php echo $this->option_name; ?>[taxonomies][]" 501 value="<?php echo $taxonomy->name; ?>" 502 <?php if ( $this->is_taxonomy( $taxonomy->name ) ) : ?> 503 checked="checked" 504 <?php endif; ?> 505 /> 506 <?php echo $taxonomy->labels->name ?> 460 507 </label> 461 508 <?php -
simple-slug-translate/trunk/readme.txt
r2500058 r2500594 5 5 Requires at least: 4.3 6 6 Tested up to: 5.7 7 Stable tag: 2.7. 17 Stable tag: 2.7.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 110 110 == Changelog == 111 111 112 = 2.7.2 = 113 * Add taxonomy settings 114 112 115 = 2.7.1 = 113 116 * Fixed bug -
simple-slug-translate/trunk/simple-slug-translate.php
r2500058 r2500594 4 4 * Plugin URI: https://github.com/ko31/simple-slug-translate 5 5 * Description: Simple Slug Translate can translate the post, page, category and taxonomy slugs to English automatically. 6 * Version: 2.7. 16 * Version: 2.7.2 7 7 * Author: Ko Takagi 8 8 * Author URI: https://go-sign.info … … 173 173 foreach ( $this->options['post_types'] as $enabled_post_type ) { 174 174 if ( $enabled_post_type == $post_type ) { 175 return true; 176 } 177 } 178 179 return false; 180 } 181 182 public function is_taxonomy( $taxonomy ) { 183 if ( empty( $this->options['taxonomies'] ) ) { 184 return false; 185 } 186 187 foreach ( $this->options['taxonomies'] as $enabled_taxonomy ) { 188 if ( $enabled_taxonomy == $taxonomy ) { 175 189 return true; 176 190 } … … 195 209 196 210 public function wp_insert_term_data( $data, $taxonomy, $args ) { 211 if ( ! $this->is_taxonomy( $taxonomy ) ) { 212 return $data; 213 } 214 197 215 if ( ! empty( $data ) && empty( $args['slug'] ) ) { 198 216 $slug = $this->call_translate( $data['name'] ); … … 353 371 __( 'Enabled post types', $this->text_domain ), 354 372 array( $this, 'post_types_callback' ), 373 $this->plugin_slug, 374 'permission_settings' 375 ); 376 377 add_settings_field( 378 'taxonomies', 379 __( 'Enabled taxonomies', $this->text_domain ), 380 array( $this, 'taxonomies_callback' ), 355 381 $this->plugin_slug, 356 382 'permission_settings' … … 458 484 /> 459 485 <?php echo $post_type->labels->name ?> 486 </label> 487 <?php 488 endforeach; 489 } 490 491 public function taxonomies_callback() { 492 $taxonomies = get_taxonomies( array( 493 'show_ui' => true 494 ), 'objects' ); 495 foreach ( $taxonomies as $taxonomy ) : 496 ?> 497 <label> 498 <input 499 type="checkbox" 500 name="<?php echo $this->option_name; ?>[taxonomies][]" 501 value="<?php echo $taxonomy->name; ?>" 502 <?php if ( $this->is_taxonomy( $taxonomy->name ) ) : ?> 503 checked="checked" 504 <?php endif; ?> 505 /> 506 <?php echo $taxonomy->labels->name ?> 460 507 </label> 461 508 <?php
Note: See TracChangeset
for help on using the changeset viewer.