Plugin Directory

Changeset 3301247


Ignore:
Timestamp:
05/27/2025 07:54:40 AM (10 months ago)
Author:
Chouby
Message:

Version 3.7.2

Location:
polylang
Files:
1 deleted
5 edited
210 copied

Legend:

Unmodified
Added
Removed
  • polylang/tags/3.7.2/admin/admin-nav-menu.php

    r3243124 r3301247  
    178178        foreach ( $locations as $loc => $menu ) {
    179179            $infos = $this->explode_location( $loc );
    180             $nav_menus[ $this->theme ][ $infos['location'] ][ $infos['lang'] ] = $menu;
     180            $nav_menus[ $this->theme ][ $infos['location'] ][ $infos['lang'] ] = $menu ?: 0;
    181181
    182182            if ( $this->options->get( 'default_lang' ) !== $infos['lang'] ) {
  • polylang/tags/3.7.2/modules/sync/sync.php

    r3243124 r3301247  
    189189
    190190    /**
    191      * Synchronize term parent in translations
     191     * Synchronize term parent in translations.
    192192     * Calling clean_term_cache *after* this is mandatory otherwise the $taxonomy_children option is not correctly updated
    193193     *
     
    202202        global $wpdb;
    203203
    204         if ( is_taxonomy_hierarchical( $taxonomy ) && $this->model->is_translated_taxonomy( $taxonomy ) ) {
    205             $term = get_term( $term_id );
    206 
    207             if ( $term instanceof WP_Term ) {
    208                 $translations = $this->model->term->get_translations( $term_id );
    209 
    210                 foreach ( $translations as $lang => $tr_id ) {
    211                     if ( $tr_id !== $term_id ) {
    212                         $tr_parent = $this->model->term->get_translation( $term->parent, $lang );
    213                         $tr_term   = get_term( (int) $tr_id, $taxonomy );
    214 
    215                         if ( $tr_term instanceof WP_Term && ! ( $term->parent && empty( $tr_parent ) ) ) {
    216                             $wpdb->update(
    217                                 $wpdb->term_taxonomy,
    218                                 array( 'parent' => $tr_parent ?: 0 ),
    219                                 array( 'term_taxonomy_id' => $tr_term->term_taxonomy_id )
    220                             );
    221 
    222                             clean_term_cache( $tr_id, $taxonomy ); // OK since WP 3.9.
    223                         }
    224                     }
    225                 }
     204        if ( ! is_taxonomy_hierarchical( $taxonomy ) || ! $this->model->is_translated_taxonomy( $taxonomy ) ) {
     205            return;
     206        }
     207
     208        $term = get_term( $term_id );
     209        if ( ! $term instanceof WP_Term ) {
     210            return;
     211        }
     212
     213        $translations = $this->model->term->get_translations( $term_id );
     214
     215        foreach ( $translations as $lang => $tr_id ) {
     216            if ( $tr_id === $term_id ) {
     217                continue;
     218            }
     219           
     220            $tr_parent = $this->model->term->get_translation( $term->parent, $lang );
     221            $tr_term   = get_term( (int) $tr_id, $taxonomy );
     222
     223            if ( str_starts_with( current_filter(), 'created_' ) && 0 === $tr_parent ) {
     224                // Do not remove the existing hierarchy of translations when creating new term without parent.
     225                continue;
     226            }
     227
     228            if ( $tr_term instanceof WP_Term && ! ( $term->parent && empty( $tr_parent ) ) ) {
     229                $wpdb->update(
     230                    $wpdb->term_taxonomy,
     231                    array( 'parent' => $tr_parent ?: 0 ),
     232                    array( 'term_taxonomy_id' => $tr_term->term_taxonomy_id )
     233                );
     234
     235                clean_term_cache( $tr_id, $taxonomy ); // OK since WP 3.9.
    226236            }
    227237        }
  • polylang/tags/3.7.2/polylang.php

    r3287486 r3301247  
    1111 * Plugin URI:        https://polylang.pro
    1212 * Description:       Adds multilingual capability to WordPress
    13  * Version:           3.7.1
     13 * Version:           3.7.2
    1414 * Requires at least: 6.2
    1515 * Requires PHP:      7.2
     
    5353} else {
    5454    // Go on loading the plugin
    55     define( 'POLYLANG_VERSION', '3.7.1' );
     55    define( 'POLYLANG_VERSION', '3.7.2' );
    5656    define( 'PLL_MIN_WP_VERSION', '6.2' );
    5757    define( 'PLL_MIN_PHP_VERSION', '7.2' );
  • polylang/tags/3.7.2/readme.txt

    r3287486 r3301247  
    66Tested up to: 6.8
    77Requires PHP: 7.2
    8 Stable tag: 3.7.1
     8Stable tag: 3.7.2
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    103103== Changelog ==
    104104
     105= 3.7.2 (2025-05-27) =
     106
     107* Pro: Require ACF 6.0+ to activate the integration to avoid fatal errors with older versions
     108* Pro: Add a new ACF field group setting to decide if translations instructions must be displayed
     109* Pro: Fix a fatal error when using ACF blocks with ACF < 6.3.0
     110* Pro: Fix regression preventing to translate Oembed, URL and Email ACF fields
     111* Pro: Fix ACF fields not translated when they have a default value
     112* Pro: Fix empty ACF fields values not copied when the field has a default value
     113* Pro: Fix ACF field default values not translated when copying a post
     114* Pro: Fix possible fatal error if invalid types of data are sent for machine translation
     115* Pro: Fix term meta removed when a term is machine translated
     116* Fix nav menu locations not saved if invalid data are stored in database #1659
     117* Fix parent relationship removed when a new translated term is create without parent #1671
     118
    105119= 3.7.1 (2025-05-05) =
    106120
    107 * Pro: Do not display ACF fileds translations settings when language location is set.
     121* Pro: Do not display ACF fields translations settings when language location is set.
    108122* Pro: Fix ACF taxonomy field terms not synchronized when "Save Terms" and "load terms" settings are activated.
    109123* Pro: Fix duplicate options when using numeric keys for ACF choice fields.
  • polylang/tags/3.7.2/vendor/composer/installed.php

    r3287486 r3301247  
    44        'pretty_version' => '3.7.x-dev',
    55        'version' => '3.7.9999999.9999999-dev',
    6         'reference' => 'c9cc69a8d359f38742a26cd353428f7d9d4f3d92',
     6        'reference' => 'e7571e0f384b20aa3b6274c77c843e688192ec59',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => '3.7.x-dev',
    1515            'version' => '3.7.9999999.9999999-dev',
    16             'reference' => 'c9cc69a8d359f38742a26cd353428f7d9d4f3d92',
     16            'reference' => 'e7571e0f384b20aa3b6274c77c843e688192ec59',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • polylang/trunk/admin/admin-nav-menu.php

    r3243124 r3301247  
    178178        foreach ( $locations as $loc => $menu ) {
    179179            $infos = $this->explode_location( $loc );
    180             $nav_menus[ $this->theme ][ $infos['location'] ][ $infos['lang'] ] = $menu;
     180            $nav_menus[ $this->theme ][ $infos['location'] ][ $infos['lang'] ] = $menu ?: 0;
    181181
    182182            if ( $this->options->get( 'default_lang' ) !== $infos['lang'] ) {
  • polylang/trunk/modules/sync/sync.php

    r3243124 r3301247  
    189189
    190190    /**
    191      * Synchronize term parent in translations
     191     * Synchronize term parent in translations.
    192192     * Calling clean_term_cache *after* this is mandatory otherwise the $taxonomy_children option is not correctly updated
    193193     *
     
    202202        global $wpdb;
    203203
    204         if ( is_taxonomy_hierarchical( $taxonomy ) && $this->model->is_translated_taxonomy( $taxonomy ) ) {
    205             $term = get_term( $term_id );
    206 
    207             if ( $term instanceof WP_Term ) {
    208                 $translations = $this->model->term->get_translations( $term_id );
    209 
    210                 foreach ( $translations as $lang => $tr_id ) {
    211                     if ( $tr_id !== $term_id ) {
    212                         $tr_parent = $this->model->term->get_translation( $term->parent, $lang );
    213                         $tr_term   = get_term( (int) $tr_id, $taxonomy );
    214 
    215                         if ( $tr_term instanceof WP_Term && ! ( $term->parent && empty( $tr_parent ) ) ) {
    216                             $wpdb->update(
    217                                 $wpdb->term_taxonomy,
    218                                 array( 'parent' => $tr_parent ?: 0 ),
    219                                 array( 'term_taxonomy_id' => $tr_term->term_taxonomy_id )
    220                             );
    221 
    222                             clean_term_cache( $tr_id, $taxonomy ); // OK since WP 3.9.
    223                         }
    224                     }
    225                 }
     204        if ( ! is_taxonomy_hierarchical( $taxonomy ) || ! $this->model->is_translated_taxonomy( $taxonomy ) ) {
     205            return;
     206        }
     207
     208        $term = get_term( $term_id );
     209        if ( ! $term instanceof WP_Term ) {
     210            return;
     211        }
     212
     213        $translations = $this->model->term->get_translations( $term_id );
     214
     215        foreach ( $translations as $lang => $tr_id ) {
     216            if ( $tr_id === $term_id ) {
     217                continue;
     218            }
     219           
     220            $tr_parent = $this->model->term->get_translation( $term->parent, $lang );
     221            $tr_term   = get_term( (int) $tr_id, $taxonomy );
     222
     223            if ( str_starts_with( current_filter(), 'created_' ) && 0 === $tr_parent ) {
     224                // Do not remove the existing hierarchy of translations when creating new term without parent.
     225                continue;
     226            }
     227
     228            if ( $tr_term instanceof WP_Term && ! ( $term->parent && empty( $tr_parent ) ) ) {
     229                $wpdb->update(
     230                    $wpdb->term_taxonomy,
     231                    array( 'parent' => $tr_parent ?: 0 ),
     232                    array( 'term_taxonomy_id' => $tr_term->term_taxonomy_id )
     233                );
     234
     235                clean_term_cache( $tr_id, $taxonomy ); // OK since WP 3.9.
    226236            }
    227237        }
  • polylang/trunk/polylang.php

    r3287486 r3301247  
    1111 * Plugin URI:        https://polylang.pro
    1212 * Description:       Adds multilingual capability to WordPress
    13  * Version:           3.7.1
     13 * Version:           3.7.2
    1414 * Requires at least: 6.2
    1515 * Requires PHP:      7.2
     
    5353} else {
    5454    // Go on loading the plugin
    55     define( 'POLYLANG_VERSION', '3.7.1' );
     55    define( 'POLYLANG_VERSION', '3.7.2' );
    5656    define( 'PLL_MIN_WP_VERSION', '6.2' );
    5757    define( 'PLL_MIN_PHP_VERSION', '7.2' );
  • polylang/trunk/readme.txt

    r3287486 r3301247  
    66Tested up to: 6.8
    77Requires PHP: 7.2
    8 Stable tag: 3.7.1
     8Stable tag: 3.7.2
    99License: GPLv3 or later
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    103103== Changelog ==
    104104
     105= 3.7.2 (2025-05-27) =
     106
     107* Pro: Require ACF 6.0+ to activate the integration to avoid fatal errors with older versions
     108* Pro: Add a new ACF field group setting to decide if translations instructions must be displayed
     109* Pro: Fix a fatal error when using ACF blocks with ACF < 6.3.0
     110* Pro: Fix regression preventing to translate Oembed, URL and Email ACF fields
     111* Pro: Fix ACF fields not translated when they have a default value
     112* Pro: Fix empty ACF fields values not copied when the field has a default value
     113* Pro: Fix ACF field default values not translated when copying a post
     114* Pro: Fix possible fatal error if invalid types of data are sent for machine translation
     115* Pro: Fix term meta removed when a term is machine translated
     116* Fix nav menu locations not saved if invalid data are stored in database #1659
     117* Fix parent relationship removed when a new translated term is create without parent #1671
     118
    105119= 3.7.1 (2025-05-05) =
    106120
    107 * Pro: Do not display ACF fileds translations settings when language location is set.
     121* Pro: Do not display ACF fields translations settings when language location is set.
    108122* Pro: Fix ACF taxonomy field terms not synchronized when "Save Terms" and "load terms" settings are activated.
    109123* Pro: Fix duplicate options when using numeric keys for ACF choice fields.
  • polylang/trunk/vendor/composer/installed.php

    r3287486 r3301247  
    44        'pretty_version' => '3.7.x-dev',
    55        'version' => '3.7.9999999.9999999-dev',
    6         'reference' => 'c9cc69a8d359f38742a26cd353428f7d9d4f3d92',
     6        'reference' => 'e7571e0f384b20aa3b6274c77c843e688192ec59',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => '3.7.x-dev',
    1515            'version' => '3.7.9999999.9999999-dev',
    16             'reference' => 'c9cc69a8d359f38742a26cd353428f7d9d4f3d92',
     16            'reference' => 'e7571e0f384b20aa3b6274c77c843e688192ec59',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.