Plugin Directory

Changeset 2358313


Ignore:
Timestamp:
08/12/2020 07:21:11 AM (6 years ago)
Author:
wp-buddy
Message:

Updated to version 2.3.3

Location:
google-analytics-opt-out/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • google-analytics-opt-out/trunk/google-analytics-opt-out.php

    r2261745 r2358313  
    44Plugin URI: https://wp-buddy.com/products/plugins/google-analytics-opt-out
    55Description: Provides an Opt-Out functionality for Google Analytics
    6 Version: 2.3.2
     6Version: 2.3.3
    77Author: WP-Buddy
    88Author URI: https://wp-buddy.com
  • google-analytics-opt-out/trunk/inc/shortcodes.php

    r1634286 r2358313  
    2525 * Adds the shortcodes
    2626 *
     27 * @return void
    2728 * @since 1.0
    28  * @return void
    2929 */
    3030function gaoop_init_shortcodes() {
     
    4040 * Creating the shortcode content
    4141 *
    42  * @param array  $atts
     42 * @param array $atts
    4343 * @param string $content
    4444 *
     45 * @return string
    4546 * @since 1.0
    4647 *
    47  * @return string
    4848 */
    4949function gaoop_shortcode( $atts, $content = '' ) {
     
    6868 * Close the banner button shortcode.
    6969 *
    70  * @param array  $atts
     70 * @param array $atts
    7171 * @param string $content
    7272 * @param string $name
    7373 *
     74 * @return string
    7475 * @since 1.4.0
    75  *
    76  * @return string
    7776 */
    7877function gaoop_shortcode_close( $atts, $content, $name ) {
    7978
    8079    if ( empty( $content ) ) {
    81         $content = __( 'OK', 'google-analytics-opt-out' );
     80        $content = __( 'Close Opt-Out Banner', 'google-analytics-opt-out' );
    8281    }
    8382
    84     return sprintf( '<a href="#" class="gaoop-close-link">%s</a>', $content );
     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() );
    85103}
    86104
  • google-analytics-opt-out/trunk/readme.txt

    r2261745 r2358313  
    33Donate link: https://wp-buddy.com/products/plugins/google-analytics-opt-out/
    44Tags: google analytics opt-out, monster insights, gdpr, dsgvo
    5 Version: 2.3.2
    6 Stable tag: 2.3.2
     5Version: 2.3.3
     6Stable tag: 2.3.3
    77Requires at least: 4.8.0
    8 Tested up to: 5.4
     8Tested up to: 5.5
    99Requires PHP: 5.6.0
    1010License: GPLv2
     
    4242
    4343== Changelog ==
     44
     45= 2.3.3 =
     46* Fixed: [google_analytics_optout_close] shortcode did not close the popup
    4447
    4548= 2.3.2 =
Note: See TracChangeset for help on using the changeset viewer.