Skip to content

Commit 16ae34f

Browse files
committed
Merge branch 'release/1.0.9'
2 parents 9fd9564 + 6865bf2 commit 16ae34f

File tree

5 files changed

+781
-372
lines changed

5 files changed

+781
-372
lines changed

dokan-wpml.php

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
* Plugin Name: Dokan - WPML Integration
44
* Plugin URI: https://wedevs.com/
55
* Description: WPML and Dokan compatible package
6-
* Version: 1.0.8
6+
* Version: 1.0.9
77
* Author: weDevs
88
* Author URI: https://wedevs.com/
99
* Text Domain: dokan-wpml
1010
* WC requires at least: 5.5.0
11-
* WC tested up to: 7.7.2
11+
* WC tested up to: 8.2.2
1212
* Domain Path: /languages/
1313
* License: GPL2
1414
*/
@@ -120,6 +120,7 @@ public function plugins_loaded() {
120120
add_filter( 'dokan_get_navigation_url', [ $this, 'load_translated_url' ], 10, 2 );
121121
add_filter( 'body_class', [ $this, 'add_dashboard_template_class_if_wpml' ], 99 );
122122
add_filter( 'dokan_get_current_page_id', [ $this, 'dokan_set_current_page_id' ] );
123+
add_filter( 'dokan_get_translated_page_id', [ $this, 'dokan_get_translated_page_id' ] );
123124
add_filter( 'dokan_get_dashboard_nav', [ $this, 'replace_dokan_dashboard_nav_key' ] );
124125
add_action( 'wp_head', [ $this, 'dokan_wpml_remove_fix_fallback_links' ] );
125126

@@ -467,6 +468,23 @@ public function dokan_set_current_page_id( $page_id ) {
467468
return wpml_object_id_filter( $page_id, 'page', true, wpml_get_default_language() );
468469
}
469470

471+
/**
472+
* Dokan get translated page id.
473+
*
474+
* @since 1.0.9
475+
*
476+
* @param int $page_id Page ID to be translated.
477+
*
478+
* @return int
479+
*/
480+
public function dokan_get_translated_page_id( $page_id ) {
481+
if ( ! function_exists( 'wpml_object_id_filter' ) ) {
482+
return $page_id;
483+
}
484+
485+
return wpml_object_id_filter( $page_id, 'page', true, ICL_LANGUAGE_CODE );
486+
}
487+
470488
/**
471489
* Get raw value from database
472490
*

languages/dokan-wpml.pot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This file is distributed under the GPL2.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Dokan - WPML Integration 1.0.8\n"
5+
"Project-Id-Version: Dokan - WPML Integration 1.0.9\n"
66
"Report-Msgid-Bugs-To: http://wedevs.com/support/\n"
7-
"POT-Creation-Date: 2023-06-08 07:19:39+00:00\n"
7+
"POT-Creation-Date: 2023-12-12 05:23:23+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
@@ -13,14 +13,14 @@ msgstr ""
1313
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
1414
"X-Generator: grunt-wp-i18n 1.0.3\n"
1515

16-
#: dokan-wpml.php:178
16+
#: dokan-wpml.php:179
1717
#. translators: %1$s: opening anchor tag, %2$s: closing anchor tag
1818
msgid ""
1919
"<b>Dokan - WPML Integration</b> requires %1$s Dokan plugin %2$s to be "
2020
"installed & activated!"
2121
msgstr ""
2222

23-
#: dokan-wpml.php:184
23+
#: dokan-wpml.php:185
2424
#. translators: %1$s: opening anchor tag, %2$s: closing anchor tag
2525
msgid ""
2626
"<b>Dokan - WPML Integration</b> requires %1$s WPML Multilingual CMS %2$s to "

0 commit comments

Comments
 (0)