Version Description
- Fixed: [google_analytics_optout_close] shortcode did not close the popup
Download this release
Release Info
Developer | wp-buddy |
Plugin | Google Analytics Opt-Out |
Version | 2.3.3 |
Comparing to | |
See all releases |
Code changes from version 2.3.2 to 2.3.3
- google-analytics-opt-out.php +1 -1
- inc/shortcodes.php +26 -8
- readme.txt +6 -3
google-analytics-opt-out.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Google Analytics Opt-Out
|
4 |
Plugin URI: https://wp-buddy.com/products/plugins/google-analytics-opt-out
|
5 |
Description: Provides an Opt-Out functionality for Google Analytics
|
6 |
-
Version: 2.3.
|
7 |
Author: WP-Buddy
|
8 |
Author URI: https://wp-buddy.com
|
9 |
License: GPL2
|
3 |
Plugin Name: Google Analytics Opt-Out
|
4 |
Plugin URI: https://wp-buddy.com/products/plugins/google-analytics-opt-out
|
5 |
Description: Provides an Opt-Out functionality for Google Analytics
|
6 |
+
Version: 2.3.3
|
7 |
Author: WP-Buddy
|
8 |
Author URI: https://wp-buddy.com
|
9 |
License: GPL2
|
inc/shortcodes.php
CHANGED
@@ -24,8 +24,8 @@ function gaoop_has_shortcode( $shortcode, $content = '' ) {
|
|
24 |
/**
|
25 |
* Adds the shortcodes
|
26 |
*
|
27 |
-
* @since 1.0
|
28 |
* @return void
|
|
|
29 |
*/
|
30 |
function gaoop_init_shortcodes() {
|
31 |
|
@@ -39,12 +39,12 @@ add_action( 'init', 'gaoop_init_shortcodes' );
|
|
39 |
/**
|
40 |
* Creating the shortcode content
|
41 |
*
|
42 |
-
* @param array
|
43 |
* @param string $content
|
44 |
*
|
|
|
45 |
* @since 1.0
|
46 |
*
|
47 |
-
* @return string
|
48 |
*/
|
49 |
function gaoop_shortcode( $atts, $content = '' ) {
|
50 |
|
@@ -67,21 +67,39 @@ function gaoop_shortcode( $atts, $content = '' ) {
|
|
67 |
/**
|
68 |
* Close the banner button shortcode.
|
69 |
*
|
70 |
-
* @param array
|
71 |
* @param string $content
|
72 |
* @param string $name
|
73 |
*
|
74 |
-
* @since 1.4.0
|
75 |
-
*
|
76 |
* @return string
|
|
|
77 |
*/
|
78 |
function gaoop_shortcode_close( $atts, $content, $name ) {
|
79 |
|
80 |
if ( empty( $content ) ) {
|
81 |
-
$content = __( '
|
82 |
}
|
83 |
|
84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
}
|
86 |
|
87 |
/**
|
24 |
/**
|
25 |
* Adds the shortcodes
|
26 |
*
|
|
|
27 |
* @return void
|
28 |
+
* @since 1.0
|
29 |
*/
|
30 |
function gaoop_init_shortcodes() {
|
31 |
|
39 |
/**
|
40 |
* Creating the shortcode content
|
41 |
*
|
42 |
+
* @param array $atts
|
43 |
* @param string $content
|
44 |
*
|
45 |
+
* @return string
|
46 |
* @since 1.0
|
47 |
*
|
|
|
48 |
*/
|
49 |
function gaoop_shortcode( $atts, $content = '' ) {
|
50 |
|
67 |
/**
|
68 |
* Close the banner button shortcode.
|
69 |
*
|
70 |
+
* @param array $atts
|
71 |
* @param string $content
|
72 |
* @param string $name
|
73 |
*
|
|
|
|
|
74 |
* @return string
|
75 |
+
* @since 1.4.0
|
76 |
*/
|
77 |
function gaoop_shortcode_close( $atts, $content, $name ) {
|
78 |
|
79 |
if ( empty( $content ) ) {
|
80 |
+
$content = __( 'Close Opt-Out Banner', 'google-analytics-opt-out' );
|
81 |
}
|
82 |
|
83 |
+
ob_start();
|
84 |
+
?>
|
85 |
+
<script>
|
86 |
+
(function () {
|
87 |
+
var links = document.querySelectorAll('.gaoop-close-link');
|
88 |
+
|
89 |
+
for (var i = 0; i < links.length; i++) {
|
90 |
+
links[i].addEventListener('click', function (e) {
|
91 |
+
e.preventDefault();
|
92 |
+
var elm = document.querySelector('#gaoop_checkbox');
|
93 |
+
if (elm.checked === false) {
|
94 |
+
elm.click();
|
95 |
+
}
|
96 |
+
})
|
97 |
+
}
|
98 |
+
}());
|
99 |
+
</script>
|
100 |
+
<?php
|
101 |
+
|
102 |
+
return sprintf( '<a href="#" class="gaoop-close-link">%s</a>%s', $content, ob_get_clean() );
|
103 |
}
|
104 |
|
105 |
/**
|
readme.txt
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
Contributors: wp-buddy, floriansimeth
|
3 |
Donate link: https://wp-buddy.com/products/plugins/google-analytics-opt-out/
|
4 |
Tags: google analytics opt-out, monster insights, gdpr, dsgvo
|
5 |
-
Version: 2.3.
|
6 |
-
Stable tag: 2.3.
|
7 |
Requires at least: 4.8.0
|
8 |
-
Tested up to: 5.
|
9 |
Requires PHP: 5.6.0
|
10 |
License: GPLv2
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -42,6 +42,9 @@ The free and the pro version have now been merged together. So you now can have
|
|
42 |
|
43 |
== Changelog ==
|
44 |
|
|
|
|
|
|
|
45 |
= 2.3.2 =
|
46 |
* Fixed: Make sure the JavaScript file is loaded correctly using the `wp_enqueue_scripts` filter.
|
47 |
|
2 |
Contributors: wp-buddy, floriansimeth
|
3 |
Donate link: https://wp-buddy.com/products/plugins/google-analytics-opt-out/
|
4 |
Tags: google analytics opt-out, monster insights, gdpr, dsgvo
|
5 |
+
Version: 2.3.3
|
6 |
+
Stable tag: 2.3.3
|
7 |
Requires at least: 4.8.0
|
8 |
+
Tested up to: 5.5
|
9 |
Requires PHP: 5.6.0
|
10 |
License: GPLv2
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
42 |
|
43 |
== Changelog ==
|
44 |
|
45 |
+
= 2.3.3 =
|
46 |
+
* Fixed: [google_analytics_optout_close] shortcode did not close the popup
|
47 |
+
|
48 |
= 2.3.2 =
|
49 |
* Fixed: Make sure the JavaScript file is loaded correctly using the `wp_enqueue_scripts` filter.
|
50 |
|