Plugin Directory

Changeset 2695085


Ignore:
Timestamp:
03/16/2022 11:25:03 PM (4 years ago)
Author:
elevio
Message:

Adding support for multi-lingual categories

Location:
elevio/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • elevio/trunk/elevio.php

    r2641517 r2695085  
    66Author: Elevio
    77Author URI: https://elev.io
    8 Version: 4.3.0
     8Version: 4.4.0
    99*/
    1010
  • elevio/trunk/plugin_files/models/post.php

    r2481895 r2695085  
    111111            $sitepress->switch_lang($language);
    112112        }
     113        $is_multilanguage_allowed = Elevio::get_instance()->multi_language_is_enabled();
     114        $tax_type = Elevio::get_instance()->get_category_taxonomy();
     115        $default_language = $sitepress->get_default_language();
     116        global $sitepress;
    113117
    114118        if ($wp_categories = wp_get_object_terms($this->id, $args['taxonomy'])) {
    115119            foreach ($wp_categories as $wp_category) {
     120
     121                // Unify category id if the translation is enabled
     122                if ($is_multilanguage_allowed) {
     123                    $wp_category->term_id = wpml_object_id_filter($wp_category->term_id, $tax_type, true, $default_language);
     124                }
     125
    116126                $category = new Elevio_Sync_Category($wp_category);
    117127                if ($category->id == 1 && $category->slug == 'uncategorized' && $args['taxonomy'] == 'category') {
  • elevio/trunk/readme.txt

    r2641517 r2695085  
    44Stable tag: 4.9.8
    55Requires at least: 2.8
    6 Tested up to: 5.6.6
     6Tested up to: 5.9.2
    77
    88Elevio for WordPress plugin that integrates with your existing knowledge base, chat client, support system and more
     
    3838
    3939== Changelog ==
     40
     41= 4.4.0 =
     42* Improved category support for multi-lingual content when WPML is used.
    4043
    4144= 4.3.0 =
Note: See TracChangeset for help on using the changeset viewer.