Changeset 2500058
- Timestamp:
- 03/20/2021 11:52:04 AM (5 years ago)
- Location:
- simple-slug-translate
- Files:
-
- 4 edited
- 1 copied
-
tags/2.7.1 (copied) (copied from simple-slug-translate/trunk)
-
tags/2.7.1/readme.txt (modified) (2 diffs)
-
tags/2.7.1/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.1/readme.txt
r2499947 r2500058 5 5 Requires at least: 4.3 6 6 Tested up to: 5.7 7 Stable tag: 2.7. 07 Stable tag: 2.7.1 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.1 = 113 * Fixed bug 114 112 115 = 2.7.0 = 113 116 * Add supported languages -
simple-slug-translate/tags/2.7.1/simple-slug-translate.php
r2499947 r2500058 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. 06 * Version: 2.7.1 7 7 * Author: Ko Takagi 8 8 * Author URI: https://go-sign.info … … 220 220 public function translate( $text ) { 221 221 if ( empty( $this->options['apikey'] ) || 222 empty( $this->options['endpoint'] ) ||223 222 empty( $this->options['source'] ) ) { 224 223 return array( … … 229 228 $auth = base64_encode( 'apikey:' . $this->options['apikey'] ); 230 229 231 $endpoint = $this->options['endpoint'] . '/v3/translate?version=2018-05-01'; 230 $location_endpoint = ( $this->options['endpoint'] ) ?: $this->get_default_endpoint(); 231 $endpoint = $location_endpoint . '/v3/translate?version=2018-05-01'; 232 232 233 233 $response = wp_remote_post( $endpoint, … … 410 410 ?> 411 411 <input name="<?php echo $this->option_name; ?>[endpoint]" type="text" id="endpoint" value="<?php echo $endpoint; ?>" 412 placeholder=" " class="regular-text">412 placeholder="<?php echo esc_attr( $this->get_default_endpoint() ); ?>" class="regular-text"> 413 413 <?php 414 414 } … … 552 552 } 553 553 554 public function get_default_endpoint() { 555 return 'https://gateway.watsonplatform.net/language-translator/api'; 556 } 557 554 558 public function mbfunctions_exist() { 555 559 return ( function_exists( 'mb_strlen' ) ) ? true : false; -
simple-slug-translate/trunk/readme.txt
r2499947 r2500058 5 5 Requires at least: 4.3 6 6 Tested up to: 5.7 7 Stable tag: 2.7. 07 Stable tag: 2.7.1 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.1 = 113 * Fixed bug 114 112 115 = 2.7.0 = 113 116 * Add supported languages -
simple-slug-translate/trunk/simple-slug-translate.php
r2499947 r2500058 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. 06 * Version: 2.7.1 7 7 * Author: Ko Takagi 8 8 * Author URI: https://go-sign.info … … 220 220 public function translate( $text ) { 221 221 if ( empty( $this->options['apikey'] ) || 222 empty( $this->options['endpoint'] ) ||223 222 empty( $this->options['source'] ) ) { 224 223 return array( … … 229 228 $auth = base64_encode( 'apikey:' . $this->options['apikey'] ); 230 229 231 $endpoint = $this->options['endpoint'] . '/v3/translate?version=2018-05-01'; 230 $location_endpoint = ( $this->options['endpoint'] ) ?: $this->get_default_endpoint(); 231 $endpoint = $location_endpoint . '/v3/translate?version=2018-05-01'; 232 232 233 233 $response = wp_remote_post( $endpoint, … … 410 410 ?> 411 411 <input name="<?php echo $this->option_name; ?>[endpoint]" type="text" id="endpoint" value="<?php echo $endpoint; ?>" 412 placeholder=" " class="regular-text">412 placeholder="<?php echo esc_attr( $this->get_default_endpoint() ); ?>" class="regular-text"> 413 413 <?php 414 414 } … … 552 552 } 553 553 554 public function get_default_endpoint() { 555 return 'https://gateway.watsonplatform.net/language-translator/api'; 556 } 557 554 558 public function mbfunctions_exist() { 555 559 return ( function_exists( 'mb_strlen' ) ) ? true : false;
Note: See TracChangeset
for help on using the changeset viewer.