1
1
<?php
2
- /*
3
- Plugin Name: Dokan - WPML Integration
4
- Plugin URI: https://wedevs.com/
5
- Description: WPML and Dokan compitable package
6
- Version: 1.0.3
7
- Author: weDevs
8
- Author URI: https://wedevs.com/
9
- Text Domain: dokan-wpml
10
- WC requires at least: 3.0
11
- WC tested up to: 4.7.1
12
- Domain Path: /languages/
13
- License: GPL2
14
- */
2
+ /**
3
+ * Plugin Name: Dokan - WPML Integration
4
+ * Plugin URI: https://wedevs.com/
5
+ * Description: WPML and Dokan compitable package
6
+ * Version: 1.0.4
7
+ * Author: weDevs
8
+ * Author URI: https://wedevs.com/
9
+ * Text Domain: dokan-wpml
10
+ * WC requires at least: 3.0
11
+ * WC tested up to: 5.2.2
12
+ * Domain Path: /languages/
13
+ * License: GPL2
14
+ */
15
15
16
16
/**
17
17
* Copyright (c) YEAR weDevs (email: [email protected] ). All rights reserved.
@@ -414,6 +414,8 @@ public function get_raw_option( $option, $section, $default = '' ) {
414
414
* Remove callback links with WPML on vendor dashboard
415
415
*
416
416
* @since 1.0.3
417
+ *
418
+ * @return void
417
419
*/
418
420
public function dokan_wpml_remove_fix_fallback_links () {
419
421
if ( function_exists ( 'dokan_is_seller_dashboard ' ) && ! dokan_is_seller_dashboard () ) {
@@ -428,16 +430,22 @@ public function dokan_wpml_remove_fix_fallback_links() {
428
430
}
429
431
430
432
/**
433
+ * Load store page language switcher filter
434
+ *
435
+ * @since 1.0.4
436
+ *
431
437
* @param \WP_query $query
432
438
* @param array $store_info
439
+ *
440
+ * @return void
433
441
*/
434
442
public function load_store_page_language_switcher_filter ( $ query , $ store_info ) {
435
443
// This needs to be improved, I am probably missing a smarter way to get the current store URL.
436
444
// Perhaps the current store URL could be included in the $store_info (2nd argument).
437
445
$ custom_store_url = dokan_get_option ( 'custom_store_url ' , 'dokan_general ' , 'store ' );
438
- $ store_slug = $ query ->get ( $ custom_store_url );
439
- $ store_user = get_user_by ( 'slug ' , $ store_slug );
440
- $ store_url = dokan_get_store_url ( $ store_user ->ID );
446
+ $ store_slug = $ query ->get ( $ custom_store_url );
447
+ $ store_user = get_user_by ( 'slug ' , $ store_slug );
448
+ $ store_url = dokan_get_store_url ( $ store_user ->ID );
441
449
442
450
add_filter ( 'wpml_ls_language_url ' , function ( $ url , $ data ) use ( $ store_url ) {
443
451
return apply_filters ( 'wpml_permalink ' , $ store_url , $ data ['code ' ] );
0 commit comments