Plugin Directory

Changeset 2742250


Ignore:
Timestamp:
06/14/2022 12:42:06 PM (4 years ago)
Author:
vinema
Message:

internal changes

Location:
vine-ma/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vine-ma/trunk/readme.txt

    r2682304 r2742250  
    2121
    2222== Changelog ==
     23
     24= 1.1.4 =
     25* Internal changes
    2326
    2427= 1.1.3 =
  • vine-ma/trunk/vine_ma_plugin.php

    r2466774 r2742250  
    33/**
    44 * Plugin Name: Vine MA - Email Marketing, Forms, Interactive Bot Forms, Chatbot, Analytics
    5  * Version: 1.1.3
     5 * Version: 1.1.4
    66 * Description: Vine is a Marketing automation tool to generate more leads from your web site. Vine includes web forms, interactive bot forms, landing pages, AI chatbot, visitor tracking, and other functionality to help you to make your site more interesting and to know better what your visitors do there.
    77 * Author: Vine Oy
     
    9090    $orgid = vine_ma_get_option('organization_id');
    9191    $src = VINEHOST."/track/t.js?sg={$orgid}";
    92     wp_enqueue_script('vinematrack', $src, array(), null);
    93 }
     92    wp_enqueue_script('vinematrack', $src, array(), null);
     93    wp_script_add_data('vinematrack', 'main-track-script', true );
     94    $srcac = VINEHOST."/track/allowCookies.js";
     95    wp_enqueue_script('vinematrackac', $srcac, array(), null);
     96    wp_script_add_data('vinematrackac', 'ac-track-script', true );
     97}
     98function vine_track_scripts_attributes( $tag, $handle ) {
     99    if ( wp_scripts()->get_data( $handle, 'main-track-script' ) ) {
     100        $tag = str_replace( '></', ' data-cookieconsent="ignore"></', $tag );
     101        $tag = str_replace( '<script', '<script type="text/javascript"', $tag );
     102    }
     103    if ( wp_scripts()->get_data( $handle, 'ac-track-script' ) ) {
     104        $tag = str_replace( '></', ' data-cookieconsent="marketing" async></', $tag );
     105        $tag = str_replace( '<script', '<script type="text/plain"', $tag );
     106    }
     107    return $tag;
     108}
    94109add_action( 'wp_enqueue_scripts', 'vine_ma_wpes_hook_add_script');
     110add_filter( 'script_loader_tag', 'vine_track_scripts_attributes', 10, 2 );
    95111
    96112add_action( 'wp_ajax_vine_ma_save_option', 'vine_ma_hook_save_option' );
Note: See TracChangeset for help on using the changeset viewer.