diff --git a/dokan-wpml.php b/dokan-wpml.php index f78963b..de43196 100755 --- a/dokan-wpml.php +++ b/dokan-wpml.php @@ -73,6 +73,7 @@ public function __construct() { // Load all filters hook add_filter( 'dokan_get_navigation_url', array( $this, 'load_translated_url' ), 10 ,2 ); add_filter( 'body_class', array( $this, 'add_dashboard_template_class_if_wpml' ), 99 ); + add_filter( 'dokan_get_current_page_id', [ $this, 'dokan_set_current_page_id' ] ); } /** @@ -293,6 +294,19 @@ public function load_scripts_and_style() { return false; } + /** + * Dokan set current page id + * + * @since 1.0.2 + * + * @param int page_id + * + * @return int + */ + public function dokan_set_current_page_id( $page_id ) { + return wpml_object_id_filter( $page_id, 'page', true, wpml_get_default_language() ); + } + } // Dokan_WPML function dokan_load_wpml() {