Version Description
- Fixed: more_info_target option not saving
- Fixed: button text getting cropped
- Changed: default position of accept button with notification text
Download this release
Release Info
Developer | Catapult_Themes |
Plugin | Cookie Consent |
Version | 2.0.3 |
Comparing to | |
See all releases |
Code changes from version 2.0.2 to 2.0.3
- admin/class-ctcc-admin.php +44 -9
- assets/css/style.css +7 -2
- public/class-ctcc-public.php +8 -1
- public/customizer.php +18 -2
- readme.txt +8 -4
- uk-cookie-consent.php +1 -1
admin/class-ctcc-admin.php
CHANGED
@@ -245,6 +245,14 @@ if ( ! class_exists ( 'CTCC_Admin' ) ) {
|
|
245 |
'ctcc_styles_section'
|
246 |
);
|
247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
add_settings_field (
|
249 |
'x_close',
|
250 |
__( 'Use X Close', 'uk-cookie-consent' ),
|
@@ -339,9 +347,9 @@ if ( ! class_exists ( 'CTCC_Admin' ) ) {
|
|
339 |
} else {
|
340 |
$defaults = array (
|
341 |
'heading_text' => __ ( 'Cookies', 'uk-cookie-consent' ),
|
342 |
-
'notification_text' => __ ( 'This site uses cookies
|
343 |
-
'accept_text' => __ ( '
|
344 |
-
'more_info_text' => __ ( '
|
345 |
'more_info_page' => get_option( 'ctcc_more_info_page', '' ),
|
346 |
'more_info_url' => '',
|
347 |
'more_info_target' => '_blank',
|
@@ -354,27 +362,47 @@ if ( ! class_exists ( 'CTCC_Admin' ) ) {
|
|
354 |
public function get_default_styles_settings() {
|
355 |
$previous_settings = get_option ( 'catapult_cookie_options' );
|
356 |
$defaults = array (
|
357 |
-
'position' => '
|
358 |
'container_class' => '',
|
359 |
'enqueue_styles' => 1,
|
360 |
'rounded_corners' => 1,
|
361 |
'drop_shadow' => 1,
|
|
|
362 |
'x_close' => 0,
|
363 |
-
'text_color' => '',
|
364 |
-
'bg_color' => '#
|
365 |
-
'link_color' => '',
|
366 |
'button_color' => '',
|
367 |
'button_bg_color' => '',
|
368 |
);
|
369 |
// Check for settings from previous version
|
370 |
-
|
|
|
371 |
$defaults['position'] = $previous_settings['catapult_cookie_bar_position_settings'] . '-bar';
|
|
|
|
|
|
|
372 |
$defaults['text_color'] = $previous_settings['catapult_cookie_text_colour_settings'];
|
|
|
|
|
|
|
373 |
$defaults['bg_color'] = $previous_settings['catapult_cookie_bg_colour_settings'];
|
|
|
|
|
|
|
374 |
$defaults['link_color'] = $previous_settings['catapult_cookie_link_colour_settings'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
$defaults['button_bg_color'] = $previous_settings['catapult_cookie_button_colour_settings'];
|
376 |
}
|
|
|
377 |
return $defaults;
|
|
|
378 |
}
|
379 |
|
380 |
public function closure_render() {
|
@@ -471,7 +499,7 @@ if ( ! class_exists ( 'CTCC_Admin' ) ) {
|
|
471 |
}
|
472 |
|
473 |
public function more_info_target_render() {
|
474 |
-
$ctcc_content_settings = get_option( '
|
475 |
<select name='ctcc_content_settings[more_info_target]'>
|
476 |
<option value='_blank' <?php selected( $ctcc_content_settings['more_info_target'], '_blank' ); ?>><?php _e ( 'New Tab', 'uk-cookie-consent' ); ?></option>
|
477 |
<option value='_self' <?php selected( $ctcc_content_settings['more_info_target'], '_self' ); ?>><?php _e ( 'Same Tab', 'uk-cookie-consent' ); ?></option>
|
@@ -526,6 +554,13 @@ if ( ! class_exists ( 'CTCC_Admin' ) ) {
|
|
526 |
<?php
|
527 |
}
|
528 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
529 |
public function x_close_render() {
|
530 |
$options = get_option( 'ctcc_styles_settings' ); ?>
|
531 |
<input type='checkbox' name='ctcc_styles_settings[x_close]' <?php checked ( ! empty ( $options['x_close'] ), 1 ); ?> value='1'>
|
245 |
'ctcc_styles_section'
|
246 |
);
|
247 |
|
248 |
+
add_settings_field (
|
249 |
+
'display_accept_with_text',
|
250 |
+
__( 'Display Button With Text', 'uk-cookie-consent' ),
|
251 |
+
array ( $this, 'display_accept_with_text_render' ),
|
252 |
+
'ctcc_styles',
|
253 |
+
'ctcc_styles_section'
|
254 |
+
);
|
255 |
+
|
256 |
add_settings_field (
|
257 |
'x_close',
|
258 |
__( 'Use X Close', 'uk-cookie-consent' ),
|
347 |
} else {
|
348 |
$defaults = array (
|
349 |
'heading_text' => __ ( 'Cookies', 'uk-cookie-consent' ),
|
350 |
+
'notification_text' => __ ( 'This site uses cookies: ', 'uk-cookie-consent' ),
|
351 |
+
'accept_text' => __ ( 'Okay, thanks', 'uk-cookie-consent' ),
|
352 |
+
'more_info_text' => __ ( 'Find out more.', 'uk-cookie-consent' ),
|
353 |
'more_info_page' => get_option( 'ctcc_more_info_page', '' ),
|
354 |
'more_info_url' => '',
|
355 |
'more_info_target' => '_blank',
|
362 |
public function get_default_styles_settings() {
|
363 |
$previous_settings = get_option ( 'catapult_cookie_options' );
|
364 |
$defaults = array (
|
365 |
+
'position' => 'top-bar',
|
366 |
'container_class' => '',
|
367 |
'enqueue_styles' => 1,
|
368 |
'rounded_corners' => 1,
|
369 |
'drop_shadow' => 1,
|
370 |
+
'display_accept_with_text' => 1,
|
371 |
'x_close' => 0,
|
372 |
+
'text_color' => '#ddd',
|
373 |
+
'bg_color' => '#464646',
|
374 |
+
'link_color' => '#fff',
|
375 |
'button_color' => '',
|
376 |
'button_bg_color' => '',
|
377 |
);
|
378 |
// Check for settings from previous version
|
379 |
+
|
380 |
+
if ( ! empty ( $previous_settings['catapult_cookie_bar_position_settings'] ) ) {
|
381 |
$defaults['position'] = $previous_settings['catapult_cookie_bar_position_settings'] . '-bar';
|
382 |
+
}
|
383 |
+
|
384 |
+
if ( ! empty ( $previous_settings['catapult_cookie_text_colour_settings'] ) ) {
|
385 |
$defaults['text_color'] = $previous_settings['catapult_cookie_text_colour_settings'];
|
386 |
+
}
|
387 |
+
|
388 |
+
if ( ! empty ( $previous_settings['catapult_cookie_bg_colour_settings'] ) ) {
|
389 |
$defaults['bg_color'] = $previous_settings['catapult_cookie_bg_colour_settings'];
|
390 |
+
}
|
391 |
+
|
392 |
+
if ( ! empty ( $previous_settings['catapult_cookie_link_colour_settings'] ) ) {
|
393 |
$defaults['link_color'] = $previous_settings['catapult_cookie_link_colour_settings'];
|
394 |
+
}
|
395 |
+
|
396 |
+
if ( ! empty ( $previous_settings['catapult_cookie_link_colour_settings'] ) ) {
|
397 |
+
$defaults['link_color'] = $previous_settings['catapult_cookie_link_colour_settings'];
|
398 |
+
}
|
399 |
+
|
400 |
+
if ( ! empty ( $previous_settings['catapult_cookie_button_colour_settings'] ) ) {
|
401 |
$defaults['button_bg_color'] = $previous_settings['catapult_cookie_button_colour_settings'];
|
402 |
}
|
403 |
+
|
404 |
return $defaults;
|
405 |
+
|
406 |
}
|
407 |
|
408 |
public function closure_render() {
|
499 |
}
|
500 |
|
501 |
public function more_info_target_render() {
|
502 |
+
$ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
|
503 |
<select name='ctcc_content_settings[more_info_target]'>
|
504 |
<option value='_blank' <?php selected( $ctcc_content_settings['more_info_target'], '_blank' ); ?>><?php _e ( 'New Tab', 'uk-cookie-consent' ); ?></option>
|
505 |
<option value='_self' <?php selected( $ctcc_content_settings['more_info_target'], '_self' ); ?>><?php _e ( 'Same Tab', 'uk-cookie-consent' ); ?></option>
|
554 |
<?php
|
555 |
}
|
556 |
|
557 |
+
public function display_accept_with_text_render() {
|
558 |
+
$options = get_option( 'ctcc_styles_settings' ); ?>
|
559 |
+
<input type='checkbox' name='ctcc_styles_settings[display_accept_with_text]' <?php checked ( ! empty ( $options['display_accept_with_text'] ), 1 ); ?> value='1'>
|
560 |
+
<p class="description"><?php _e ( 'Display the confirmation button with notification text', 'uk-cookie-consent' ); ?></p>
|
561 |
+
<?php
|
562 |
+
}
|
563 |
+
|
564 |
public function x_close_render() {
|
565 |
$options = get_option( 'ctcc_styles_settings' ); ?>
|
566 |
<input type='checkbox' name='ctcc_styles_settings[x_close]' <?php checked ( ! empty ( $options['x_close'] ), 1 ); ?> value='1'>
|
assets/css/style.css
CHANGED
@@ -5,6 +5,7 @@ html.has-cookie-bar.cookie-bar-top-bar {
|
|
5 |
transition: all 0.25s;
|
6 |
}
|
7 |
#catapult-cookie-bar {
|
|
|
8 |
max-height: 0;
|
9 |
opacity: 0;
|
10 |
direction: ltr;
|
@@ -40,7 +41,7 @@ html.has-cookie-bar.cookie-bar-top-bar {
|
|
40 |
display: block;
|
41 |
margin: 1em 0;
|
42 |
}
|
43 |
-
.cookie-bar-bar #catapult-cookie-bar span.ctcc-right-side {
|
44 |
float: right;
|
45 |
}
|
46 |
button#catapultCookie {
|
@@ -55,9 +56,13 @@ button#catapultCookie {
|
|
55 |
display: flex;
|
56 |
-webkit-align-items: center;
|
57 |
align-items: center;
|
|
|
|
|
|
|
|
|
|
|
58 |
-webkit-justify-content: space-between;
|
59 |
justify-content: space-between;
|
60 |
-
position: relative;
|
61 |
}
|
62 |
.cookie-bar-block #catapult-cookie-bar h3 {
|
63 |
margin: 0.5em 0 0;
|
5 |
transition: all 0.25s;
|
6 |
}
|
7 |
#catapult-cookie-bar {
|
8 |
+
box-sizing: border-box;
|
9 |
max-height: 0;
|
10 |
opacity: 0;
|
11 |
direction: ltr;
|
41 |
display: block;
|
42 |
margin: 1em 0;
|
43 |
}
|
44 |
+
.cookie-bar-bar #catapult-cookie-bar.float-accept span.ctcc-right-side {
|
45 |
float: right;
|
46 |
}
|
47 |
button#catapultCookie {
|
56 |
display: flex;
|
57 |
-webkit-align-items: center;
|
58 |
align-items: center;
|
59 |
+
-webkit-justify-content: center;
|
60 |
+
justify-content: center;
|
61 |
+
position: relative;
|
62 |
+
}
|
63 |
+
.cookie-bar-bar .float-accept .ctcc-inner {
|
64 |
-webkit-justify-content: space-between;
|
65 |
justify-content: space-between;
|
|
|
66 |
}
|
67 |
.cookie-bar-block #catapult-cookie-bar h3 {
|
68 |
margin: 0.5em 0 0;
|
public/class-ctcc-public.php
CHANGED
@@ -61,6 +61,10 @@ if ( ! class_exists( 'CTCC_Public' ) ) { // Don't initialise if there's already
|
|
61 |
$options = get_option ( 'ctcc_options_settings' );
|
62 |
$ctcc_styles_settings = get_option ( 'ctcc_styles_settings' );
|
63 |
|
|
|
|
|
|
|
|
|
64 |
// Figure out the bar position
|
65 |
if ( $ctcc_styles_settings['position'] == 'top-bar' ) {
|
66 |
$position_css = 'position: fixed;
|
@@ -208,10 +212,13 @@ if ( ! class_exists( 'CTCC_Public' ) ) { // Don't initialise if there's already
|
|
208 |
if ( ! empty ( $ctcc_styles_settings['x_close'] ) ) {
|
209 |
$classes .= ' use_x_close';
|
210 |
}
|
|
|
|
|
|
|
211 |
|
212 |
// Allowed tags
|
213 |
$allowed = array (
|
214 |
-
'a' => array(
|
215 |
'href' => array(),
|
216 |
'title' => array()
|
217 |
),
|
61 |
$options = get_option ( 'ctcc_options_settings' );
|
62 |
$ctcc_styles_settings = get_option ( 'ctcc_styles_settings' );
|
63 |
|
64 |
+
$position_css = 'position: fixed;
|
65 |
+
left: 0;
|
66 |
+
top: 0;
|
67 |
+
width: 100%;';
|
68 |
// Figure out the bar position
|
69 |
if ( $ctcc_styles_settings['position'] == 'top-bar' ) {
|
70 |
$position_css = 'position: fixed;
|
212 |
if ( ! empty ( $ctcc_styles_settings['x_close'] ) ) {
|
213 |
$classes .= ' use_x_close';
|
214 |
}
|
215 |
+
if ( empty ( $ctcc_styles_settings['display_accept_with_text'] ) ) {
|
216 |
+
$classes .= ' float-accept';
|
217 |
+
}
|
218 |
|
219 |
// Allowed tags
|
220 |
$allowed = array (
|
221 |
+
'a' => array (
|
222 |
'href' => array(),
|
223 |
'title' => array()
|
224 |
),
|
public/customizer.php
CHANGED
@@ -106,6 +106,22 @@ function ctcc_customize_register( $wp_customize ) {
|
|
106 |
'label' => __( 'Drop Shadow', 'cctc' ),
|
107 |
'description' => __( 'Add drop shadow to the block.', 'cctc' )
|
108 |
) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
$wp_customize -> add_setting( 'ctcc_styles_settings[x_close]', array(
|
110 |
'type' => 'option', // or 'option'
|
111 |
'capability' => 'edit_theme_options',
|
@@ -117,7 +133,7 @@ function ctcc_customize_register( $wp_customize ) {
|
|
117 |
) );
|
118 |
$wp_customize -> add_control( 'ctcc_styles_settings[x_close]', array(
|
119 |
'type' => 'checkbox',
|
120 |
-
'priority' =>
|
121 |
'section' => 'cctc', // Required, core or custom.
|
122 |
'label' => __( 'Use X Close', 'cctc' ),
|
123 |
'description' => __( 'Replace confirmation button with \'X\' icon.', 'cctc' )
|
@@ -133,7 +149,7 @@ function ctcc_customize_register( $wp_customize ) {
|
|
133 |
) );
|
134 |
$wp_customize -> add_control( 'ctcc_styles_settings[text_color]', array(
|
135 |
'type' => 'color',
|
136 |
-
'priority' =>
|
137 |
'section' => 'cctc', // Required, core or custom.
|
138 |
'label' => __( 'Text Color', 'cctc' ),
|
139 |
'description' => __( 'Text color for your notification bar.', 'cctc' )
|
106 |
'label' => __( 'Drop Shadow', 'cctc' ),
|
107 |
'description' => __( 'Add drop shadow to the block.', 'cctc' )
|
108 |
) );
|
109 |
+
$wp_customize -> add_setting( 'ctcc_styles_settings[display_accept_with_text]', array(
|
110 |
+
'type' => 'option', // or 'option'
|
111 |
+
'capability' => 'edit_theme_options',
|
112 |
+
'theme_supports' => '', // Rarely needed.
|
113 |
+
'default' => '',
|
114 |
+
'transport' => 'refresh', // or postMessage
|
115 |
+
'sanitize_callback' => '',
|
116 |
+
'sanitize_js_callback' => '', // Basically to_json.
|
117 |
+
) );
|
118 |
+
$wp_customize -> add_control( 'ctcc_styles_settings[display_accept_with_text]', array(
|
119 |
+
'type' => 'checkbox',
|
120 |
+
'priority' => 9, // Within the section.
|
121 |
+
'section' => 'cctc', // Required, core or custom.
|
122 |
+
'label' => __( 'Display Button With Text', 'cctc' ),
|
123 |
+
'description' => __( 'Deselect to float button to right.', 'cctc' )
|
124 |
+
) );
|
125 |
$wp_customize -> add_setting( 'ctcc_styles_settings[x_close]', array(
|
126 |
'type' => 'option', // or 'option'
|
127 |
'capability' => 'edit_theme_options',
|
133 |
) );
|
134 |
$wp_customize -> add_control( 'ctcc_styles_settings[x_close]', array(
|
135 |
'type' => 'checkbox',
|
136 |
+
'priority' => 10, // Within the section.
|
137 |
'section' => 'cctc', // Required, core or custom.
|
138 |
'label' => __( 'Use X Close', 'cctc' ),
|
139 |
'description' => __( 'Replace confirmation button with \'X\' icon.', 'cctc' )
|
149 |
) );
|
150 |
$wp_customize -> add_control( 'ctcc_styles_settings[text_color]', array(
|
151 |
'type' => 'color',
|
152 |
+
'priority' => 15, // Within the section.
|
153 |
'section' => 'cctc', // Required, core or custom.
|
154 |
'label' => __( 'Text Color', 'cctc' ),
|
155 |
'description' => __( 'Text color for your notification bar.', 'cctc' )
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate Link: https://paypal.com
|
|
4 |
Tags: cookie law, cookies, EU, implied consent, uk cookie consent, compliance, eu cookie law, eu privacy directive, privacy, privacy directive, consent, cookie, cookie compliance, cookie law, eu cookie, notice, notification, notify, cookie notice, cookie notification, cookie notify
|
5 |
Requires at least: 4.3
|
6 |
Tested up to: 4.4.1
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -76,12 +76,16 @@ You will find more details of the regulations on the [Information Commissioner's
|
|
76 |
|
77 |
== Changelog ==
|
78 |
|
|
|
|
|
|
|
|
|
|
|
79 |
= 2.0.2 =
|
80 |
-
*
|
81 |
-
* Added: Reset button to restore default settings
|
82 |
|
83 |
= 2.0.1 =
|
84 |
-
*
|
85 |
|
86 |
= 2.0.0 =
|
87 |
* Major rewrite
|
4 |
Tags: cookie law, cookies, EU, implied consent, uk cookie consent, compliance, eu cookie law, eu privacy directive, privacy, privacy directive, consent, cookie, cookie compliance, cookie law, eu cookie, notice, notification, notify, cookie notice, cookie notification, cookie notify
|
5 |
Requires at least: 4.3
|
6 |
Tested up to: 4.4.1
|
7 |
+
Stable tag: 2.0.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
76 |
|
77 |
== Changelog ==
|
78 |
|
79 |
+
= 2.0.3 =
|
80 |
+
* Fixed: more_info_target option not saving
|
81 |
+
* Fixed: button text getting cropped
|
82 |
+
* Changed: default position of accept button with notification text
|
83 |
+
|
84 |
= 2.0.2 =
|
85 |
+
* Fixed: retain settings from previous version
|
|
|
86 |
|
87 |
= 2.0.1 =
|
88 |
+
* Fixed: admin formatting
|
89 |
|
90 |
= 2.0.0 =
|
91 |
* Major rewrite
|
uk-cookie-consent.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Cookie Consent
|
4 |
Plugin URI: http://catapultthemes.com/cookie-consent/
|
5 |
Description: The only cookie consent plugin you'll ever need.
|
6 |
-
Version: 2.0.
|
7 |
Author: Catapult_Themes
|
8 |
Author URI: http://catapultthemes.com/
|
9 |
Text Domain: uk-cookie-consent
|
3 |
Plugin Name: Cookie Consent
|
4 |
Plugin URI: http://catapultthemes.com/cookie-consent/
|
5 |
Description: The only cookie consent plugin you'll ever need.
|
6 |
+
Version: 2.0.3
|
7 |
Author: Catapult_Themes
|
8 |
Author URI: http://catapultthemes.com/
|
9 |
Text Domain: uk-cookie-consent
|