|
3 | 3 | * Plugin Name: Dokan - WPML Integration |
4 | 4 | * Plugin URI: https://wedevs.com/ |
5 | 5 | * Description: WPML and Dokan compatible package |
6 | | - * Version: 1.1.10 |
| 6 | + * Version: 1.1.11 |
7 | 7 | * Author: weDevs |
8 | 8 | * Author URI: https://wedevs.com/ |
9 | 9 | * Text Domain: dokan-wpml |
10 | 10 | * WC requires at least: 8.5.0 |
11 | | - * WC tested up to: 9.7.0 |
| 11 | + * WC tested up to: 10.2.2 |
12 | 12 | * Domain Path: /languages/ |
13 | 13 | * License: GPL2 |
14 | 14 | */ |
@@ -204,6 +204,8 @@ public function plugins_loaded() { |
204 | 204 |
|
205 | 205 | add_action( 'dokan_product_delete', [ $this, 'before_product_delete' ] ); |
206 | 206 | add_action( 'dokan_product_bulk_delete', [ $this, 'before_product_delete' ] ); |
| 207 | + |
| 208 | + add_action( 'wp_enqueue_scripts', [ $this, 'enqueue' ] ); |
207 | 209 | } |
208 | 210 |
|
209 | 211 | /** |
@@ -656,6 +658,8 @@ public function set_language_switcher_copy_param( $params ) { |
656 | 658 | 'ticket_keyword', |
657 | 659 | 'ticket_status', |
658 | 660 | 'dokan-support-listing-search-nonce', |
| 661 | + 'zone_id', |
| 662 | + 'instance_id', |
659 | 663 | ]; |
660 | 664 |
|
661 | 665 | return array_merge( $params, $dokan_params ); |
@@ -1816,19 +1820,44 @@ public function get_original_string_using_translated_string_id( string $translat |
1816 | 1820 | ); |
1817 | 1821 | } |
1818 | 1822 |
|
1819 | | - /** |
1820 | | - * Support WPML delete post actions on the frontend dashboard. |
1821 | | - * |
1822 | | - * @since 1.1.7 |
1823 | | - * |
1824 | | - * @return void |
1825 | | - */ |
1826 | | - public function before_product_delete() { |
1827 | | - if ( class_exists( 'WPML_Frontend_Post_Actions' ) ) { |
1828 | | - global $wpml_post_translations; |
1829 | | - add_action( 'delete_post', [ $wpml_post_translations, 'delete_post_actions' ] ); |
1830 | | - } |
1831 | | - } |
| 1823 | + /** |
| 1824 | + * Support WPML delete post actions on the frontend dashboard. |
| 1825 | + * |
| 1826 | + * @since 1.1.7 |
| 1827 | + * |
| 1828 | + * @return void |
| 1829 | + */ |
| 1830 | + public function before_product_delete() { |
| 1831 | + if ( class_exists( 'WPML_Frontend_Post_Actions' ) ) { |
| 1832 | + global $wpml_post_translations; |
| 1833 | + add_action( 'delete_post', [ $wpml_post_translations, 'delete_post_actions' ] ); |
| 1834 | + } |
| 1835 | + } |
| 1836 | + |
| 1837 | + /** |
| 1838 | + * Enqueue scripts for the seller dashboard. |
| 1839 | + * |
| 1840 | + * This method enqueues the necessary JavaScript files required for the |
| 1841 | + * seller dashboard if the current page is the seller dashboard. |
| 1842 | + * |
| 1843 | + * @return void |
| 1844 | + */ |
| 1845 | + public function enqueue() { |
| 1846 | + if (! dokan_is_seller_dashboard() ) { |
| 1847 | + return; |
| 1848 | + } |
| 1849 | + |
| 1850 | + $scripts_file = include( plugin_dir_path( __FILE__ ) . 'build/index.asset.php' ); |
| 1851 | + |
| 1852 | + wp_enqueue_script( |
| 1853 | + 'dokan-wpml-switcher', |
| 1854 | + plugin_dir_url( __FILE__ ) . 'build/index.js', |
| 1855 | + $scripts_file['dependencies'], |
| 1856 | + $scripts_file['version'], |
| 1857 | + true |
| 1858 | + ); |
| 1859 | + } |
| 1860 | + |
1832 | 1861 | /** |
1833 | 1862 | * Filter language switcher URLs for Dokan store and dashboard pages |
1834 | 1863 | * |
|
0 commit comments