- Timestamp:
- 07/21/2020 08:52:44 AM (6 years ago)
- Location:
- polylang/trunk
- Files:
-
- 6 edited
-
include/widget-languages.php (modified) (2 diffs)
-
install/t15s.php (modified) (8 diffs)
-
js/nav-menu.js (modified) (1 diff)
-
js/nav-menu.min.js (modified) (1 diff)
-
polylang.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
polylang/trunk/include/widget-languages.php
r2340428 r2343963 139 139 $( '.widgets-sortables,.control-section-sidebar' ).on( 'change', '.pll-dropdown', function() { 140 140 var this_id = $( this ).parent().parent().parent().children( '.widget-id' ).attr( 'value' ); 141 pll_toggle( $( '.no-dropdown-' + this_id ), 'checked' != $( this ).attr( 'checked' ) );141 pll_toggle( $( '.no-dropdown-' + this_id ), true != $( this ).prop( 'checked' ) ); 142 142 } ); 143 143 … … 147 147 $( '.widgets-sortables,.control-section-sidebar' ).on( 'change', '.pll' + v, function() { 148 148 var this_id = $( this ).parent().parent().parent().children( '.widget-id' ).attr( 'value' ); 149 if ( 'checked' != $( this ).attr( 'checked' ) ) {149 if ( true != $( this ).prop( 'checked' ) ) { 150 150 $( '#widget-' + this_id + options[ 1-i ] ).prop( 'checked', true ); 151 151 } -
polylang/trunk/install/t15s.php
r2340428 r2343963 12 12 */ 13 13 class PLL_T15S { 14 14 /** 15 * Transient key 16 * 17 * @var string 18 */ 15 19 const TRANSIENT_KEY_PLUGIN = 't15s-registry-plugins'; 16 20 17 private $type = 'plugin'; 18 private $slug = ''; 21 /** 22 * Project directory slug 23 * 24 * @var string 25 */ 26 private $slug = ''; 27 28 /** 29 * Full GlotPress API URL for the project. 30 * 31 * @var string 32 */ 19 33 private $api_url = ''; 34 35 /** 36 * Installed translations. 37 * 38 * @var array 39 */ 40 private static $installed_translations; 41 42 /** 43 * Available languages. 44 * 45 * @var array 46 */ 47 private static $available_languages; 20 48 21 49 /** … … 33 61 add_action( 'init', array( __CLASS__, 'register_clean_translations_cache' ), 9999 ); 34 62 add_filter( 'translations_api', array( $this, 'translations_api' ), 10, 3 ); 35 add_filter( 'site_transient_update_ ' . $this->type . 's', array( $this, 'site_transient_update_plugins' ) );63 add_filter( 'site_transient_update_plugins', array( $this, 'site_transient_update_plugins' ) ); 36 64 } 37 65 … … 47 75 */ 48 76 public function translations_api( $result, $requested_type, $args ) { 49 if ( $this->type . 's' === $requested_type && $this->slug === $args['slug'] ) {50 return self::get_translations( $ this->type, $args['slug'], $this->api_url );77 if ( 'plugins' === $requested_type && $this->slug === $args['slug'] ) { 78 return self::get_translations( $args['slug'], $this->api_url ); 51 79 } 52 80 … … 72 100 } 73 101 74 $translations = self::get_translations( $this-> type, $this->slug, $this->api_url );102 $translations = self::get_translations( $this->slug, $this->api_url ); 75 103 76 104 if ( ! isset( $translations['translations'] ) ) { … … 78 106 } 79 107 80 $installed_translations = wp_get_installed_translations( $this->type . 's');108 $installed_translations = self::get_installed_translations(); 81 109 82 110 foreach ( (array) $translations['translations'] as $translation ) { 83 if ( in_array( $translation['language'], get_available_languages() ) ) {111 if ( in_array( $translation['language'], self::get_available_languages() ) ) { 84 112 if ( isset( $installed_translations[ $this->slug ][ $translation['language'] ] ) && $translation['updated'] ) { 85 113 $local = new DateTime( $installed_translations[ $this->slug ][ $translation['language'] ]['PO-Revision-Date'] ); … … 91 119 } 92 120 93 $translation['type'] = $this->type;121 $translation['type'] = 'plugin'; 94 122 $translation['slug'] = $this->slug; 95 123 … … 142 170 * @since 2.6 143 171 * 144 * @param string $type Project type. Either plugin or theme.145 172 * @param string $slug Project directory slug. 146 173 * @param string $url Full GlotPress API URL for the project. 147 174 * @return array Translation data. 148 175 */ 149 private static function get_translations( $ type, $slug, $url ) {176 private static function get_translations( $slug, $url ) { 150 177 $translations = get_site_transient( self::TRANSIENT_KEY_PLUGIN ); 151 178 … … 171 198 return $result; 172 199 } 200 201 /** 202 * Returns installed translations. 203 * 204 * Used to cache the result of wp_get_installed_translations() as it is very expensive. 205 * 206 * @since 2.8 207 * 208 * @return array 209 */ 210 private static function get_installed_translations() { 211 if ( null === self::$installed_translations ) { 212 self::$installed_translations = wp_get_installed_translations( 'plugins' ); 213 } 214 return self::$installed_translations; 215 } 216 217 /** 218 * Returns available languages. 219 * 220 * Used to cache the result of get_available_languages() as it is very expensive. 221 * 222 * @since 2.8 223 * 224 * @return array 225 */ 226 private static function get_available_languages() { 227 if ( null === self::$available_languages ) { 228 self::$available_languages = get_available_languages(); 229 } 230 return self::$available_languages; 231 } 173 232 } -
polylang/trunk/js/nav-menu.js
r2340428 r2343963 86 86 $( '#edit-menu-item-show_' + v + id ).change( 87 87 function() { 88 if ( 'checked' != $( this ).attr( 'checked' ) ) {88 if ( true != $( this ).prop( 'checked' ) ) { 89 89 $( '#edit-menu-item-show_' + options[ 1 - i ] + id ).prop( 'checked', true ); 90 90 } -
polylang/trunk/js/nav-menu.min.js
r2277053 r2343963 1 jQuery(document).ready(function(e){e("#update-nav-menu").bind("click",function(t){t.target&&t.target.className&&-1!=t.target.className.indexOf("item-edit")&&(e("input[value='#pll_switcher'][type=text]").parent().parent().parent().each(function(){var t=e(this).attr("id").substring(19);e(this).children("p:not( .field-move )").remove(),h=e("<input>").attr({type:"hidden",id:"edit-menu-item-title-"+t,name:"menu-item-title["+t+"]",value:pll_data.title}),e(this).append(h),h=e("<input>").attr({type:"hidden",id:"edit-menu-item-url-"+t,name:"menu-item-url["+t+"]",value:"#pll_switcher"}),e(this).append(h),h=e("<input>").attr({type:"hidden",id:"edit-menu-item-pll-detect-"+t,name:"menu-item-pll-detect["+t+"]",value:1}),e(this).append(h),ids=Array("hide_if_no_translation","hide_current","force_home","show_flags","show_names","dropdown");for(var i=0,a=ids.length; i<a;i++)p=e("<p>").attr("class","description"),e(this).prepend(p),label=e("<label>").attr("for","edit-menu-item-"+ids[i]+"-"+t).text(" "+pll_data.strings[ids[i]]),p.append(label),cb=e("<input>").attr({type:"checkbox",id:"edit-menu-item-"+ids[i]+"-"+t,name:"menu-item-"+ids[i]+"["+t+"]",value:1}),(void 0!==pll_data.val[t]&&1==pll_data.val[t][ids[i]]||void 0===pll_data.val[t]&&"show_names"==ids[i])&&cb.prop("checked",!0),label.prepend(cb)}),e(".menu-item-data-object-id").each(function(){var t=e(this).val(),i=["names-","flags-"];e.each(i,function(a,n){e("#edit-menu-item-show_"+n+t).change(function(){"checked"!=e(this).attr("checked")&&e("#edit-menu-item-show_"+i[1-a]+t).prop("checked",!0)})})}))})});1 jQuery(document).ready(function(e){e("#update-nav-menu").bind("click",function(t){t.target&&t.target.className&&-1!=t.target.className.indexOf("item-edit")&&(e("input[value='#pll_switcher'][type=text]").parent().parent().parent().each(function(){var t=e(this).attr("id").substring(19);e(this).children("p:not( .field-move )").remove(),h=e("<input>").attr({type:"hidden",id:"edit-menu-item-title-"+t,name:"menu-item-title["+t+"]",value:pll_data.title}),e(this).append(h),h=e("<input>").attr({type:"hidden",id:"edit-menu-item-url-"+t,name:"menu-item-url["+t+"]",value:"#pll_switcher"}),e(this).append(h),h=e("<input>").attr({type:"hidden",id:"edit-menu-item-pll-detect-"+t,name:"menu-item-pll-detect["+t+"]",value:1}),e(this).append(h),ids=Array("hide_if_no_translation","hide_current","force_home","show_flags","show_names","dropdown");for(var i=0,a=ids.length;a>i;i++)p=e("<p>").attr("class","description"),e(this).prepend(p),label=e("<label>").attr("for","edit-menu-item-"+ids[i]+"-"+t).text(" "+pll_data.strings[ids[i]]),p.append(label),cb=e("<input>").attr({type:"checkbox",id:"edit-menu-item-"+ids[i]+"-"+t,name:"menu-item-"+ids[i]+"["+t+"]",value:1}),("undefined"!=typeof pll_data.val[t]&&1==pll_data.val[t][ids[i]]||"undefined"==typeof pll_data.val[t]&&"show_names"==ids[i])&&cb.prop("checked",!0),label.prepend(cb)}),e(".menu-item-data-object-id").each(function(){var t=e(this).val(),i=["names-","flags-"];e.each(i,function(a,n){e("#edit-menu-item-show_"+n+t).change(function(){1!=e(this).prop("checked")&&e("#edit-menu-item-show_"+i[1-a]+t).prop("checked",!0)})})}))})}); -
polylang/trunk/polylang.php
r2340428 r2343963 11 11 * Plugin URI: https://polylang.pro 12 12 * Description: Adds multilingual capability to WordPress 13 * Version: 2.8-beta 113 * Version: 2.8-beta2 14 14 * Requires at least: 4.9 15 15 * Requires PHP: 5.6 … … 54 54 } else { 55 55 // Go on loading the plugin 56 define( 'POLYLANG_VERSION', '2.8-beta 1' );56 define( 'POLYLANG_VERSION', '2.8-beta2' ); 57 57 define( 'PLL_MIN_WP_VERSION', '4.9' ); 58 58 define( 'PLL_MIN_PHP_VERSION', '5.6' ); -
polylang/trunk/readme.txt
r2340428 r2343963 1 1 === Polylang === 2 Contributors: Chouby, manooweb, raaaahman, marianne38 2 Contributors: Chouby, manooweb, raaaahman, marianne38, sebastienserre 3 3 Donate link: https://polylang.pro 4 4 Tags: multilingual, bilingual, translate, translation, language, multilanguage, international, localization … … 84 84 * Pro: Fix the possibility to create 2 terms with the same name in the same language, without specifying the second slug. 85 85 * Pro: Fix our private taxonomies being displayed in the ACF field group rules. 86 * Pro: Fix incorrect flags loaded from the block editor 87 * Pro: Fix SSO causing a wrong redirect when using subdomains (introduced in 2.7.4) 88 * Pro: Fix a performance issue on the plugins list 86 89 * Use composer for autoload and Polylang Pro dependency on Polylang 87 90 * Display a flag for each post in the posts list tables (same for terms). #515 88 91 * Add test for the homepage translations to Site Health 89 92 * Add debug information to Site Health 90 * Add compatibility with the sitemaps introduced in WP 5.5 93 * Add compatibility with the sitemaps introduced in WP 5.5 #451 91 94 * Always filter WP_Query by the current language 92 95 * Support wildcards in "admin-texts" parent keys in wpml-config.xml 93 96 * Fix sticky posts showed for all languages when the admin language filter is active #469 94 97 * Fix a performance issue on the pages list 98 * Fix dependency to jQuery Migrate removed from WP 5.5 #539 95 99 96 100 = 2.7.4 ( 2020-06-29) =
Note: See TracChangeset
for help on using the changeset viewer.