Plugin Directory

Changeset 2964319


Ignore:
Timestamp:
09/08/2023 03:51:57 AM (3 years ago)
Author:
onecommerce
Message:

Hotfix 2.9.6

Location:
transcy/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • transcy/trunk/includes/Helpers/WPQueryTranscy.php

    r2949041 r2964319  
    1111    {
    1212        if (!empty($args['is_translation'])) {
    13             switch ($args['post_type']) {
    14                 case 'post':
    15                     add_filter('posts_where', array($this, 'posts_where'));
    16                     break;
    17                 default:
    18                     break;
    19             }
     13            add_filter('posts_where', array($this, 'posts_where'));
    2014        }
    2115        parent::__construct($args);
  • transcy/trunk/includes/Hook/CategoryHook.php

    r2960387 r2964319  
    108108            "type"  => $taxonomy,
    109109            "id"    => $term_id
    110         ], 'delete-resource');
     110        ], 'change-resource');
    111111    }
    112112
  • transcy/trunk/includes/Hook/MenuHook.php

    r2960976 r2964319  
    66use Transcy\Model\TranscyMenu;
    77use Transcy\Api\AppApi\ClientApi;
     8use Transcy\Helpers\WPTermQueryTranscy;
    89
    910class MenuHook extends TermHook
     
    3435            add_action('wp_update_nav_menu_item', array($this, 'updateItemMenu'), 999, 2);
    3536            add_action('deleted_post', array($this, 'deleteItemMenu'), 999, 2);
     37
     38            add_action('admin_init', array($this, 'preTransalteMenu'));
    3639        }
    3740    }
     
    206209        // Step 4: Call app with action delete menu => Pedding
    207210    }
     211
     212    public function preTransalteMenu()
     213    {
     214        if (!empty($this->advancedLanguage)) {
     215            $args = array(
     216                'is_translation' => true,
     217                'hide_empty'     => false,
     218                'taxonomy'       => 'nav_menu',
     219            );
     220            $listMenu = (new WPTermQueryTranscy($args))->get_terms();
     221            if (!empty($listMenu)) {
     222                foreach ($this->advancedLanguage as $key => $lang) {
     223                    foreach ($listMenu as $menu) {
     224                        if (empty($this->transcyMenu->get($menu->term_id, 'nav_menu', $lang))) {
     225                            $this->transcyMenu->add($menu->term_id, $menu->term_id, 'nav_menu', $lang);
     226                        }
     227                    }
     228                }
     229            }
     230        }
     231    }
    208232}
  • transcy/trunk/readme.txt

    r2960976 r2964319  
    55Requires at least: 4.5
    66Tested up to: 6.2.0
    7 Stable tag: 2.9.5
     7Stable tag: 2.9.6
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    163163
    164164== Changelog ==
    165 = 2.9.5 - 2023-08-31 =
     165= 2.9.6 - 2023-09-08 =
    166166* Hotfix errors
    167167
  • transcy/trunk/transcy.php

    r2960976 r2964319  
    44Plugin URI: https://onecommerce.io/transcy/?utm_source=transcyphp&utm_medium=plugin-uri&utm_campaign=wordpress-tc
    55Description: Make your website multilingual easily with no coding. Instantly translate between languages with the Google Translate API.
    6 Version: 2.9.5
     6Version: 2.9.6
    77Author: OneCommerce
    88Author URI: https://onecommerce.io/transcy/?utm_source=transcyphp&utm_medium=author-uri&utm_campaign=wordpress-tc
Note: See TracChangeset for help on using the changeset viewer.