WF Cookie Consent - Version 0.8.5

Version Description

Improved compatibility with other plugins

Download this release

Release Info

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

Code changes from version 0.8.4 to 0.8.5

Files changed (2) hide show
  1. readme.txt +4 -1
  2. wf-cookie-consent.php +15 -14
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.2.2
7
- Stable tag: 0.8.4
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.8.4 =
33
  Escaped text strings for echoing in JS & option field descriptions.
34
 
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.2.2
7
+ Stable tag: 0.8.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
29
 
30
  == Changelog ==
31
 
32
+ = 0.8.5 =
33
+ Improved compatibility with other plugins
34
+
35
  = 0.8.4 =
36
  Escaped text strings for echoing in JS & option field descriptions.
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.8.4
7
  License: GNU General Public License v2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Author: wunderfarm
@@ -56,9 +56,9 @@
56
  */
57
 
58
  // add the admin options page
59
- add_action('admin_menu', 'plugin_admin_add_page');
60
 
61
- function plugin_admin_add_page() {
62
  add_options_page('WF Cookie Consent Settings', 'WF Cookie Consent', 'manage_options', 'wf-cookieconsent', 'wf_cookieconsent_options_page');
63
  }
64
 
@@ -83,24 +83,24 @@ function wf_cookieconsent_options_page(){
83
  }
84
 
85
  // add the admin settings and such
86
- add_action('admin_init', 'plugin_admin_init');
87
 
88
- function plugin_admin_init(){
89
  register_setting( 'wf_cookieconsent_options', 'wf_cookieconsent_options' );
90
 
91
  add_settings_section('plugin_main', 'General settings', '', 'wf-cookieconsent');
92
- add_settings_field('wf_position', esc_html__('Position'), 'plugin_setting_radio', 'wf-cookieconsent', 'plugin_main', array( 'fieldname' => 'wf_position', 'fielddescription' => 'Choose the position for the infobar', 'radioFields' => array( 'top' , 'bottom') ) );
93
 
94
  foreach(wf_get_languages() as $lang){
95
  add_settings_section('plugin_main_' . $lang, 'Custom settings (' . $lang . ')', '', 'wf-cookieconsent');
96
- add_settings_field('wf_linkhref', esc_html__('Page to provide more information'), 'plugin_setting_page_selector', 'wf-cookieconsent', 'plugin_main_' . $lang, array( 'fieldname' => 'wf_linkhref', 'fielddescription' => '', 'lang' => $lang ) );
97
- add_settings_field('wf_linktext', esc_html__('Link text to provide more information'), 'plugin_setting_string', 'wf-cookieconsent', 'plugin_main_' . $lang, array( 'fieldname' => 'wf_linktext', 'fielddescription' => '', 'lang' => $lang ) );
98
- add_settings_field('wf_cookietext', esc_html__('Info text'), 'plugin_setting_string', 'wf-cookieconsent', 'plugin_main_' . $lang, array( 'fieldname' => 'wf_cookietext', 'fielddescription' => '', 'lang' => $lang ) );
99
- add_settings_field('wf_dismisstext', esc_html__('Dismiss text'), 'plugin_setting_string', 'wf-cookieconsent', 'plugin_main_' . $lang, array( 'fieldname' => 'wf_dismisstext', 'fielddescription' => '', 'lang' => $lang ) );
100
  }
101
  }
102
 
103
- function plugin_setting_string($args) {
104
  $options = get_option('wf_cookieconsent_options');
105
 
106
  if(empty($options[$args['lang']][$args['fieldname']]))
@@ -110,7 +110,7 @@ function plugin_setting_string($args) {
110
  echo (empty($args['fielddescription']) ? '' : "<p class='description'>". $args['fielddescription'] ."</p>");
111
  }
112
 
113
- function plugin_setting_page_selector($args) {
114
  $options = get_option('wf_cookieconsent_options');
115
 
116
  if(empty($options[$args['lang']][$args['fieldname']]))
@@ -123,7 +123,7 @@ function plugin_setting_page_selector($args) {
123
  echo (empty($args['fielddescription']) ? '' : "<p class='description'>". $args['fielddescription'] ."</p>");
124
  }
125
 
126
- function plugin_setting_radio($args) {
127
  $options = get_option('wf_cookieconsent_options');
128
 
129
  if(empty($options[$args['fieldname']]))
@@ -132,13 +132,14 @@ function plugin_setting_radio($args) {
132
  echo "<fieldset>";
133
  if(!empty($args['radioFields'])) {
134
  foreach ($args['radioFields'] as $radioField) {
135
- echo "<input type='radio' id='' name='wf_cookieconsent_options[{$args['fieldname']}]' value='{$radioField}'" . ($radioField == $options[$args['fieldname']] ? 'checked' : '')."><label for=''>" . $radioField . "</label><br />";
136
  }
137
  }
138
  echo (empty($args['fielddescription']) ? '' : "<p class='description'>". $args['fielddescription'] ."</p>");
139
  echo "</fieldset>";
140
  }
141
 
 
142
  /*
143
  * Helpers
144
  */
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.8.5
7
  License: GNU General Public License v2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Author: wunderfarm
56
  */
57
 
58
  // add the admin options page
59
+ add_action('admin_menu', 'wf_admin_add_page');
60
 
61
+ function wf_admin_add_page() {
62
  add_options_page('WF Cookie Consent Settings', 'WF Cookie Consent', 'manage_options', 'wf-cookieconsent', 'wf_cookieconsent_options_page');
63
  }
64
 
83
  }
84
 
85
  // add the admin settings and such
86
+ add_action('admin_init', 'wf_admin_init');
87
 
88
+ function wf_admin_init(){
89
  register_setting( 'wf_cookieconsent_options', 'wf_cookieconsent_options' );
90
 
91
  add_settings_section('plugin_main', 'General settings', '', 'wf-cookieconsent');
92
+ add_settings_field('wf_position', esc_html__('Position'), 'wf_setting_radio', 'wf-cookieconsent', 'plugin_main', array( 'fieldname' => 'wf_position', 'fielddescription' => 'Choose the position for the infobar', 'radioFields' => array( 'top' , 'bottom') ) );
93
 
94
  foreach(wf_get_languages() as $lang){
95
  add_settings_section('plugin_main_' . $lang, 'Custom settings (' . $lang . ')', '', 'wf-cookieconsent');
96
+ add_settings_field('wf_linkhref', esc_html__('Page to provide more information'), 'wf_setting_page_selector', 'wf-cookieconsent', 'plugin_main_' . $lang, array( 'fieldname' => 'wf_linkhref', 'fielddescription' => '', 'lang' => $lang ) );
97
+ add_settings_field('wf_linktext', esc_html__('Link text to provide more information'), 'wf_setting_string', 'wf-cookieconsent', 'plugin_main_' . $lang, array( 'fieldname' => 'wf_linktext', 'fielddescription' => '', 'lang' => $lang ) );
98
+ add_settings_field('wf_cookietext', esc_html__('Info text'), 'wf_setting_string', 'wf-cookieconsent', 'plugin_main_' . $lang, array( 'fieldname' => 'wf_cookietext', 'fielddescription' => '', 'lang' => $lang ) );
99
+ add_settings_field('wf_dismisstext', esc_html__('Dismiss text'), 'wf_setting_string', 'wf-cookieconsent', 'plugin_main_' . $lang, array( 'fieldname' => 'wf_dismisstext', 'fielddescription' => '', 'lang' => $lang ) );
100
  }
101
  }
102
 
103
+ function wf_setting_string($args) {
104
  $options = get_option('wf_cookieconsent_options');
105
 
106
  if(empty($options[$args['lang']][$args['fieldname']]))
110
  echo (empty($args['fielddescription']) ? '' : "<p class='description'>". $args['fielddescription'] ."</p>");
111
  }
112
 
113
+ function wf_setting_page_selector($args) {
114
  $options = get_option('wf_cookieconsent_options');
115
 
116
  if(empty($options[$args['lang']][$args['fieldname']]))
123
  echo (empty($args['fielddescription']) ? '' : "<p class='description'>". $args['fielddescription'] ."</p>");
124
  }
125
 
126
+ function wf_setting_radio($args) {
127
  $options = get_option('wf_cookieconsent_options');
128
 
129
  if(empty($options[$args['fieldname']]))
132
  echo "<fieldset>";
133
  if(!empty($args['radioFields'])) {
134
  foreach ($args['radioFields'] as $radioField) {
135
+ echo "<input type='radio' id='wf_rad_" . $radioField . "' name='wf_cookieconsent_options[{$args['fieldname']}]' value='{$radioField}'" . ($radioField == $options[$args['fieldname']] ? 'checked' : '')."><label for='wf_rad_" . $radioField . "'>" . $radioField . "</label><br />";
136
  }
137
  }
138
  echo (empty($args['fielddescription']) ? '' : "<p class='description'>". $args['fielddescription'] ."</p>");
139
  echo "</fieldset>";
140
  }
141
 
142
+
143
  /*
144
  * Helpers
145
  */