| @@ -6,9 +6,9 @@ | ||
| 6 | 6 | * Author: wpLingua Translation Service |
| 7 | 7 | * Author URI: https://wplingua.com/ |
| 8 | 8 | * Text Domain: wplingua |
| 9 | 9 | * Domain Path: /languages/ |
| 10 | - * Version: 2.15.1 | |
| 10 | + * Version: 2.16.7 | |
| 11 | 11 | * Requires PHP: 7.4 |
| 12 | 12 | * License: GPL v2 or later |
| 13 | 13 | * License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 14 | 14 | */ |
| @@ -23,9 +23,9 @@ | ||
| 23 | 23 | // Define wpLingua constants |
| 24 | 24 | define( 'WPLNG_API_URL', 'https://api.wplingua.com' ); |
| 25 | 25 | define( 'WPLNG_API_VERSION', '3.0' ); |
| 26 | 26 | define( 'WPLNG_API_SSLVERIFY', true ); |
| 27 | -define( 'WPLNG_PLUGIN_VERSION', '2.15.1' ); | |
| 27 | +define( 'WPLNG_PLUGIN_VERSION', '2.16.7' ); | |
| 28 | 28 | define( 'WPLNG_PLUGIN_FILE', plugin_basename( __FILE__ ) ); |
| 29 | 29 | define( 'WPLNG_PLUGIN_DIR', __DIR__ ); |
| 30 | 30 | define( 'WPLNG_CACHE_DIR', WP_CONTENT_DIR . '/wplingua-cache' ); |
| 31 | 31 | define( 'WPLNG_PHP_MIN_VERSION', '7.4' ); |
| @@ -105,11 +105,13 @@ | ||
| 105 | 105 | // Update version number in DB |
| 106 | 106 | update_option( 'wplng_version', WPLNG_PLUGIN_VERSION, true ); |
| 107 | 107 | |
| 108 | 108 | // Clear all wpLingua cache |
| 109 | - wplng_clear_translations_cache(); | |
| 110 | - wplng_clear_slugs_cache(); | |
| 109 | + delete_option( 'wplng_cached_translations' ); | |
| 110 | + delete_option( 'wplng_cached_slugs' ); | |
| 111 | + delete_option( 'wplng_api_key_data' ); | |
| 111 | 112 | wplng_clear_folder_cache(); |
| 113 | + wplng_clear_website_cache(); | |
| 112 | 114 | |
| 113 | 115 | // Clear old cache method (version <= 2.12.3) |
| 114 | 116 | delete_transient( 'wplng_cached_translations' ); |
| 115 | 117 | delete_transient( 'wplng_cached_slugs' ); |
| @@ -174,8 +176,11 @@ | ||
| 174 | 176 | */ |
| 175 | 177 | |
| 176 | 178 | // Add menu in back office |
| 177 | 179 | add_action( 'admin_menu', 'wplng_create_menu' ); |
| 180 | + add_filter( 'parent_file', 'wplng_option_page_parent_file' ); | |
| 181 | + add_filter( 'submenu_file', 'wplng_option_page_submenu_file' ); | |
| 182 | + add_action( 'admin_head', 'wplng_option_page_hide_submenu' ); | |
| 178 | 183 | |
| 179 | 184 | // Add admin Bar menu |
| 180 | 185 | add_action( 'admin_bar_menu', 'wplng_admin_bar_menu', 81 ); |
| 181 | 186 | add_action( 'admin_bar_menu', 'wplng_admin_bar_edit', 81 ); |
| @@ -205,8 +210,11 @@ | ||
| 205 | 210 | // Add edit link on page and post list |
| 206 | 211 | add_filter( 'page_row_actions', 'wplng_row_edit_translation_link', 10, 2 ); |
| 207 | 212 | add_filter( 'post_row_actions', 'wplng_row_edit_translation_link', 10, 2 ); |
| 208 | 213 | |
| 214 | + // Notice for obtaining the PRO version | |
| 215 | + // add_action( 'admin_notices', 'wplng_admin_notice_get_pro_version', 1 ); | |
| 216 | + | |
| 209 | 217 | /** |
| 210 | 218 | * wplng_translation : CPT, taxo, meta |
| 211 | 219 | */ |
| 212 | 220 | |
| @@ -345,8 +353,11 @@ | ||
| 345 | 353 | add_action( 'init', 'wplng_ob_start', 1 ); |
| 346 | 354 | |
| 347 | 355 | // Redirect page if is called with an untranslate slug |
| 348 | 356 | add_action( 'template_redirect', 'wplng_redirect_translated_slug' ); |
| 357 | + | |
| 358 | + // Translate WooCommerce cart URL | |
| 359 | + add_filter( 'woocommerce_get_cart_url', 'wplng_url_translate' ); | |
| 349 | 360 | |
| 350 | 361 | /** |
| 351 | 362 | * Generate JSON translation on the fly for wp-i18n.js |
| 352 | 363 | */ |