Skip to content

Commit

Permalink
v1.2.7
Browse files Browse the repository at this point in the history
fix bug on new polylang locale being added
  • Loading branch information
aurovrata committed Nov 14, 2016
1 parent 533ceb9 commit d3f3cdd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
8 changes: 6 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 ==

Expand Down Expand Up @@ -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 =
Expand Down
8 changes: 4 additions & 4 deletions admin/class-cf7-polylang-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<a href="'.network_admin_url('plugins.php').'">Return to Plugins</a></a>';
wp_die( '<p><strong>CF7 Polylang Module Extension</strong> requires both <strong>CfF7 & Polylang</strong> and has been deactivated!</p>'.$button );

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cf7-polylang.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Plugin Name: Contact Form 7 Polylang extension
* Plugin URI: http://wordpress.syllogic.in
* Description: This plugin extends <a target="_blank" href="https://wordpress.org/plugins/contact-form-7/">Contact Form 7</a> plugin to manage multiple language forms using the <a target="_blank" href="https://wordpress.org/plugins/polylang/">PolyLang</a> 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+
Expand Down
4 changes: 2 additions & 2 deletions includes/class-cf7-polylang.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d3f3cdd

Please sign in to comment.