WF Cookie Consent - Version 0.9.8

Version Description

Added compatibility for WPML Version: 3.2 and above

Download this release

Release Info

Developer wunderfarm
Plugin Icon 128x128 WF Cookie Consent
Version 0.9.8
Comparing to
See all releases

Code changes from version 0.9.7 to 0.9.8

Files changed (2) hide show
  1. readme.txt +5 -2
  2. wf-cookie-consent.php +10 -5
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wunderfarm
3
  Donate link: http://wunderfarm.com/
4
  Tags: compliance, cookie law, cookielaw, cookies, cookiebar, policy, bar, eu cookie law, cookie law banner, cookiechoices, eu privacy directive, privacy, privacy directive, cookie consent, cookieconsent, Multi language, WPML, polylang, responsive, admin, code, content, embed, google, html, integration, javascript, links, login, marketing, page, pages, plugin, simple, text, url, wordpress, law,
5
  Requires at least: 3.0.1
6
- Tested up to: 4.3
7
- Stable tag: 0.9.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -29,6 +29,9 @@ WF Cookie Consent is the "wunderfarm-way" to show how your website complies with
29
 
30
  == Changelog ==
31
 
 
 
 
32
  = 0.9.7 =
33
  Improved compatibility with WPML Multilingual CMS 3.2.6
34
 
3
  Donate link: http://wunderfarm.com/
4
  Tags: compliance, cookie law, cookielaw, cookies, cookiebar, policy, bar, eu cookie law, cookie law banner, cookiechoices, eu privacy directive, privacy, privacy directive, cookie consent, cookieconsent, Multi language, WPML, polylang, responsive, admin, code, content, embed, google, html, integration, javascript, links, login, marketing, page, pages, plugin, simple, text, url, wordpress, law,
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.4
7
+ Stable tag: 0.9.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
29
 
30
  == Changelog ==
31
 
32
+ = 0.9.8 =
33
+ Added compatibility for WPML Version: 3.2 and above
34
+
35
  = 0.9.7 =
36
  Improved compatibility with WPML Multilingual CMS 3.2.6
37
 
wf-cookie-consent.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WF Cookie Consent
4
  Plugin URI: http://www.wunderfarm.com/plugins/wf-cookie-consent
5
  Description: The wunderfarm-way to show how your website complies with the EU Cookie Law.
6
- Version: 0.9.7
7
  License: GNU General Public License v2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Author: wunderfarm
@@ -229,14 +229,19 @@ if (!function_exists('wf_get_language_information')) {
229
 
230
  function wf_get_language_information($post_id) {
231
  $locale = '';
232
-
233
  if (function_exists('pll_get_post_language')) {
234
  $locale = pll_get_post_language($post_id);
235
- } else if (function_exists('wpml_get_language_information')) {
236
- $language_information = wpml_get_language_information($post_id);
237
- $locale = $language_information['display_name'];
 
238
  }
239
 
 
 
 
 
 
240
  return $locale;
241
  }
242
 
3
  Plugin Name: WF Cookie Consent
4
  Plugin URI: http://www.wunderfarm.com/plugins/wf-cookie-consent
5
  Description: The wunderfarm-way to show how your website complies with the EU Cookie Law.
6
+ Version: 0.9.8
7
  License: GNU General Public License v2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Author: wunderfarm
229
 
230
  function wf_get_language_information($post_id) {
231
  $locale = '';
 
232
  if (function_exists('pll_get_post_language')) {
233
  $locale = pll_get_post_language($post_id);
234
+ } else if (has_filter('wpml_post_language_details') ) {
235
+ $language_information = apply_filters( 'wpml_post_language_details', NULL, $post_id ) ;
236
+ } else if (function_exists('wpml_get_language_information') ) {
237
+ $language_information = wpml_get_language_information($post_id);
238
  }
239
 
240
+ if(is_wp_error($language_information))
241
+ $locale = '';
242
+ else
243
+ $locale = $language_information['display_name'];
244
+
245
  return $locale;
246
  }
247