Plugin Directory

Changeset 2432923 for polylang


Ignore:
Timestamp:
12/07/2020 07:50:50 AM (5 years ago)
Author:
Chouby
Message:

Version 2.9

Location:
polylang
Files:
2 deleted
3 edited
168 copied

Legend:

Unmodified
Added
Removed
  • polylang/tags/2.9/include/translate-option.php

    r2424335 r2432923  
    276276                    $pattern = '#^' . str_replace( '*', '(?:.+)', $name ) . '$#';
    277277
    278                     foreach ( array_keys( $values ) as $n ) {
     278                    foreach ( $values as $n => $value ) {
    279279                        // The first case could be handled by the next one, but we avoid calls to preg_match here.
    280280                        if ( '*' === $name || ( false !== strpos( $name, '*' ) && preg_match( $pattern, $n ) ) ) {
    281                             if ( is_array( $values ) && is_array( $old_values ) && isset( $old_values[ $n ], $values[ $n ] ) ) {
    282                                 $values[ $n ] = $this->check_value_recursive( $old_values[ $n ], $values[ $n ], $child );
     281                            if ( is_array( $values ) && is_array( $old_values ) && isset( $old_values[ $n ] ) ) {
     282                                $values[ $n ] = $this->check_value_recursive( $old_values[ $n ], $value, $child );
    283283                            }
    284284
    285                             if ( is_object( $values ) && is_object( $old_values ) && isset( $old_values->$n, $values->$n ) ) {
    286                                 $values->$n = $this->check_value_recursive( $old_values->$n, $values->$n, $child );
     285                            if ( is_object( $values ) && is_object( $old_values ) && isset( $old_values->$n ) ) {
     286                                $values->$n = $this->check_value_recursive( $old_values->$n, $value, $child );
    287287                            }
    288288                        }
     
    291291            } else {
    292292                // Parent key is a wildcard and no sub-key has been whitelisted.
    293                 foreach ( array_keys( $values ) as $n ) {
    294                     if ( is_array( $values ) && is_array( $old_values ) && isset( $old_values[ $n ], $values[ $n ] ) ) {
    295                         $values[ $n ] = $this->check_value_recursive( $old_values[ $n ], $values[ $n ], $child );
    296                     }
    297 
    298                     if ( is_object( $values ) && is_object( $old_values ) && isset( $old_values->$n, $values->$n ) ) {
    299                         $values->$n = $this->check_value_recursive( $old_values->$n, $values->$n, $child );
     293                foreach ( $values as $n => $value ) {
     294                    if ( is_array( $values ) && is_array( $old_values ) && isset( $old_values[ $n ] ) ) {
     295                        $values[ $n ] = $this->check_value_recursive( $old_values[ $n ], $value, $key );
     296                    }
     297
     298                    if ( is_object( $values ) && is_object( $old_values ) && isset( $old_values->$n ) ) {
     299                        $values->$n = $this->check_value_recursive( $old_values->$n, $value, $key );
    300300                    }
    301301                }
  • polylang/tags/2.9/polylang.php

    r2430247 r2432923  
    1111 * Plugin URI:        https://polylang.pro
    1212 * Description:       Adds multilingual capability to WordPress
    13  * Version:           2.9-rc1
     13 * Version:           2.9
    1414 * Requires at least: 5.1
    1515 * Requires PHP:      5.6
     
    5454} else {
    5555    // Go on loading the plugin
    56     define( 'POLYLANG_VERSION', '2.9-rc1' );
     56    define( 'POLYLANG_VERSION', '2.9' );
    5757    define( 'PLL_MIN_WP_VERSION', '5.1' );
    5858    define( 'PLL_MIN_PHP_VERSION', '5.6' );
  • polylang/tags/2.9/readme.txt

    r2430247 r2432923  
    66Tested up to: 5.6
    77Requires PHP: 5.6
    8 Stable tag: 2.8.4
     8Stable tag: 2.9
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    7979== Changelog ==
    8080
    81 = 2.9 =
     81= 2.9 (2020-12-07) =
    8282
    8383* Add compatibility with WordPress 5.6
  • polylang/trunk/include/translate-option.php

    r2424335 r2432923  
    276276                    $pattern = '#^' . str_replace( '*', '(?:.+)', $name ) . '$#';
    277277
    278                     foreach ( array_keys( $values ) as $n ) {
     278                    foreach ( $values as $n => $value ) {
    279279                        // The first case could be handled by the next one, but we avoid calls to preg_match here.
    280280                        if ( '*' === $name || ( false !== strpos( $name, '*' ) && preg_match( $pattern, $n ) ) ) {
    281                             if ( is_array( $values ) && is_array( $old_values ) && isset( $old_values[ $n ], $values[ $n ] ) ) {
    282                                 $values[ $n ] = $this->check_value_recursive( $old_values[ $n ], $values[ $n ], $child );
     281                            if ( is_array( $values ) && is_array( $old_values ) && isset( $old_values[ $n ] ) ) {
     282                                $values[ $n ] = $this->check_value_recursive( $old_values[ $n ], $value, $child );
    283283                            }
    284284
    285                             if ( is_object( $values ) && is_object( $old_values ) && isset( $old_values->$n, $values->$n ) ) {
    286                                 $values->$n = $this->check_value_recursive( $old_values->$n, $values->$n, $child );
     285                            if ( is_object( $values ) && is_object( $old_values ) && isset( $old_values->$n ) ) {
     286                                $values->$n = $this->check_value_recursive( $old_values->$n, $value, $child );
    287287                            }
    288288                        }
     
    291291            } else {
    292292                // Parent key is a wildcard and no sub-key has been whitelisted.
    293                 foreach ( array_keys( $values ) as $n ) {
    294                     if ( is_array( $values ) && is_array( $old_values ) && isset( $old_values[ $n ], $values[ $n ] ) ) {
    295                         $values[ $n ] = $this->check_value_recursive( $old_values[ $n ], $values[ $n ], $child );
    296                     }
    297 
    298                     if ( is_object( $values ) && is_object( $old_values ) && isset( $old_values->$n, $values->$n ) ) {
    299                         $values->$n = $this->check_value_recursive( $old_values->$n, $values->$n, $child );
     293                foreach ( $values as $n => $value ) {
     294                    if ( is_array( $values ) && is_array( $old_values ) && isset( $old_values[ $n ] ) ) {
     295                        $values[ $n ] = $this->check_value_recursive( $old_values[ $n ], $value, $key );
     296                    }
     297
     298                    if ( is_object( $values ) && is_object( $old_values ) && isset( $old_values->$n ) ) {
     299                        $values->$n = $this->check_value_recursive( $old_values->$n, $value, $key );
    300300                    }
    301301                }
  • polylang/trunk/polylang.php

    r2430247 r2432923  
    1111 * Plugin URI:        https://polylang.pro
    1212 * Description:       Adds multilingual capability to WordPress
    13  * Version:           2.9-rc1
     13 * Version:           2.9
    1414 * Requires at least: 5.1
    1515 * Requires PHP:      5.6
     
    5454} else {
    5555    // Go on loading the plugin
    56     define( 'POLYLANG_VERSION', '2.9-rc1' );
     56    define( 'POLYLANG_VERSION', '2.9' );
    5757    define( 'PLL_MIN_WP_VERSION', '5.1' );
    5858    define( 'PLL_MIN_PHP_VERSION', '5.6' );
  • polylang/trunk/readme.txt

    r2430247 r2432923  
    66Tested up to: 5.6
    77Requires PHP: 5.6
    8 Stable tag: 2.8.4
     8Stable tag: 2.9
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    7979== Changelog ==
    8080
    81 = 2.9 =
     81= 2.9 (2020-12-07) =
    8282
    8383* Add compatibility with WordPress 5.6
Note: See TracChangeset for help on using the changeset viewer.