Changeset 2964319
- Timestamp:
- 09/08/2023 03:51:57 AM (3 years ago)
- Location:
- transcy/trunk
- Files:
-
- 5 edited
-
includes/Helpers/WPQueryTranscy.php (modified) (1 diff)
-
includes/Hook/CategoryHook.php (modified) (1 diff)
-
includes/Hook/MenuHook.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
transcy.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
transcy/trunk/includes/Helpers/WPQueryTranscy.php
r2949041 r2964319 11 11 { 12 12 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')); 20 14 } 21 15 parent::__construct($args); -
transcy/trunk/includes/Hook/CategoryHook.php
r2960387 r2964319 108 108 "type" => $taxonomy, 109 109 "id" => $term_id 110 ], ' delete-resource');110 ], 'change-resource'); 111 111 } 112 112 -
transcy/trunk/includes/Hook/MenuHook.php
r2960976 r2964319 6 6 use Transcy\Model\TranscyMenu; 7 7 use Transcy\Api\AppApi\ClientApi; 8 use Transcy\Helpers\WPTermQueryTranscy; 8 9 9 10 class MenuHook extends TermHook … … 34 35 add_action('wp_update_nav_menu_item', array($this, 'updateItemMenu'), 999, 2); 35 36 add_action('deleted_post', array($this, 'deleteItemMenu'), 999, 2); 37 38 add_action('admin_init', array($this, 'preTransalteMenu')); 36 39 } 37 40 } … … 206 209 // Step 4: Call app with action delete menu => Pedding 207 210 } 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 } 208 232 } -
transcy/trunk/readme.txt
r2960976 r2964319 5 5 Requires at least: 4.5 6 6 Tested up to: 6.2.0 7 Stable tag: 2.9. 57 Stable tag: 2.9.6 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 163 163 164 164 == Changelog == 165 = 2.9. 5 - 2023-08-31=165 = 2.9.6 - 2023-09-08 = 166 166 * Hotfix errors 167 167 -
transcy/trunk/transcy.php
r2960976 r2964319 4 4 Plugin URI: https://onecommerce.io/transcy/?utm_source=transcyphp&utm_medium=plugin-uri&utm_campaign=wordpress-tc 5 5 Description: Make your website multilingual easily with no coding. Instantly translate between languages with the Google Translate API. 6 Version: 2.9. 56 Version: 2.9.6 7 7 Author: OneCommerce 8 8 Author 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.