Skip to content

Commit 1d31d3e

Browse files
Merge pull request #2 from ITS-Digital-Technology/feature/add-trustarc-code
Remove conditional for adding GE scripts and tweak TrustArc link styles
2 parents e73b5e8 + 5b601c2 commit 1d31d3e

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

nu_global_elements.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Description: Inserts the Northeastern University global header, footer, and TrustArc cookie consent manager. Requires wp_body_open() under the body tag to display the global header.
66
Author: Northeastern University ITS Web Solutions
77
Author URI: https://its.northeastern.edu
8-
Version: 1.2.0
8+
Version: 1.2.1
99
*/
1010

1111
/**
@@ -15,20 +15,14 @@
1515
$nu_global_elements_options = get_option( 'nu_global_elements_option_name' );
1616

1717
/**
18-
* Include global elements CSS, kernl UI and javascript from CDN, if both header and footer are not disabled in options
18+
* Include global elements CSS, kernl UI and javascript from CDN
1919
*/
20-
if (!(isset($nu_global_elements_options['disable_global_header']) && isset($nu_global_elements_options['disable_global_footer']))){
21-
add_action('wp_head', function() {
22-
23-
echo '
20+
echo '
2421
<link rel="stylesheet" href="https://global-packages.cdn.northeastern.edu/global-elements/dist/css/index.css">
2522
<script src="https://global-packages.cdn.northeastern.edu/global-elements/dist/js/index.umd.js"></script>
2623
<script src="https://global-packages.cdn.northeastern.edu/kernl-ui/dist/js/index.umd.js" defer></script>
2724
';
2825

29-
});
30-
}
31-
3226
/**
3327
* Include the global NU header, if it is not disabled in the options
3428
*
@@ -65,10 +59,17 @@
6559
*/
6660

6761
if (!isset($nu_global_elements_options['disable_trustarc'])){
68-
add_action('wp_footer', function() {
69-
70-
echo '<div x-data="NUGlobalElements.trustarc()" x-init="init()"></div>';
71-
});
62+
if (!isset($nu_global_elements_options['disable_global_footer'])){
63+
add_action('wp_footer', function() {
64+
echo '<div x-data="NUGlobalElements.trustarc()" x-init="init()"></div>';
65+
});
66+
}
67+
else {
68+
add_action('wp_footer', function() {
69+
echo '<style>#trustarc-no-ge-footer footer {padding-top: .7rem !important; text-align: center !important;}</style>';
70+
echo '<div id="trustarc-no-ge-footer" x-data="NUGlobalElements.trustarc()" x-init="init()"></div>';
71+
});
72+
}
7273
}
7374

7475

0 commit comments

Comments
 (0)