From d3f3cddf41de9d60de322241e1b49e7fb017be69 Mon Sep 17 00:00:00 2001 From: aurovrata Date: Mon, 14 Nov 2016 06:02:49 +0530 Subject: [PATCH] v1.2.7 fix bug on new polylang locale being added --- README.txt | 8 ++++++-- admin/class-cf7-polylang-admin.php | 8 ++++---- cf7-polylang.php | 2 +- includes/class-cf7-polylang.php | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.txt b/README.txt index 6eb23fc..ddfded5 100755 --- a/README.txt +++ b/README.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tags: polylang, contact form 7, multisite, contact form 7 extension, contact form 7 module, multilingual contact form 7 Requires at least: 3.0.1 Tested up to: 4.6 -Stable tag: 1.2.6 +Stable tag: 1.2.7 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -26,6 +26,7 @@ Please follow the [Installation](https://wordpress.org/plugins/cf7-polylang/inst = Thanks to = GĂ©rard Mathiuet for providing a fix for PolylangPro. +Peter J. Herrel for improving the language folder management. == Installation == @@ -61,7 +62,10 @@ This is because the translation in your language have not be completed. You can 4. There is a bug in the integration which fails to pick the fact that language options have been saved. So even after click the 'Save' button you will see the familiar alert window popup, you can safely ignore the message. == Changelog == -= 1.2.6 = += 1.2.7 = +* bug fix on new polylang locale being added. + += 1.2.6 = * improvement to folder management (contributed by Peter J. Herrel) = 1.2.5 = diff --git a/admin/class-cf7-polylang-admin.php b/admin/class-cf7-polylang-admin.php index fd9f917..24fc1b5 100755 --- a/admin/class-cf7-polylang-admin.php +++ b/admin/class-cf7-polylang-admin.php @@ -73,7 +73,7 @@ public function check_plugin_dependency() { if( !is_plugin_active("contact-form-7/wp-contact-form-7.php") || !defined ("POLYLANG_VERSION") ){ deactivate_plugins( "cf7-polylang/cf7-polylang.php" ); debug_msg("Deactivating CF7 Polylang Module Enxtension"); - + $button = 'Return to Plugins'; wp_die( '

CF7 Polylang Module Extension requires both CfF7 & Polylang and has been deactivated!

'.$button ); @@ -452,13 +452,13 @@ protected function scan_local_locales(){ * @param int $tt_id term_taxonomy_id * @param string $taxonomy the taxonomy to which the new term was added */ - public function new_plylang_locale_added( $term_id, $tt_id, $taxonomy ){ + public function new_polylang_locale_added( $term_id, $tt_id, $taxonomy ){ //check if this is the polylang language taxonomy if('language' != $taxonomy){ return; } - //let's reset the textdomain - $this->load_plugin_textdomain(); + //let's get the new locale cf7 translation + $this->get_cf7_translations(); } /** * Redirect to new table list on form delete diff --git a/cf7-polylang.php b/cf7-polylang.php index c4ebb04..b2b24a7 100755 --- a/cf7-polylang.php +++ b/cf7-polylang.php @@ -16,7 +16,7 @@ * Plugin Name: Contact Form 7 Polylang extension * Plugin URI: http://wordpress.syllogic.in * Description: This plugin extends Contact Form 7 plugin to manage multiple language forms using the PolyLang plugin. It Requires both plugins to be active first. - * Version: 1.2.6 + * Version: 1.2.7 * Author: Aurovrata V. * Author URI: http://syllogic.in * License: GPL-2.0+ diff --git a/includes/class-cf7-polylang.php b/includes/class-cf7-polylang.php index d9f5d9d..d31bdc1 100755 --- a/includes/class-cf7-polylang.php +++ b/includes/class-cf7-polylang.php @@ -69,7 +69,7 @@ class Cf7_Polylang { public function __construct() { $this->plugin_name = 'cf7-polylang'; - $this->version = '1.2.6'; + $this->version = '1.2.7'; $this->load_dependencies(); $this->set_locale(); @@ -162,7 +162,7 @@ private function define_admin_hooks() { //modify the link to new translation form page $this->loader->add_filter('pll_get_new_post_translation_link', $plugin_admin, 'cf7_new_translation_link',10,3); //Polylang new language locale added - $this->loader->add_action( 'created_term', $plugin_admin, 'new_plylang_locale_added', 10, 3 ); + $this->loader->add_action( 'created_term', $plugin_admin, 'new_polylang_locale_added', 10, 3 ); /**** WP hooks *****/ //WP hook 'manage_{$screen_id}_columns' to add new column to table list