|
5 | 5 | 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.
|
6 | 6 | Author: Northeastern University ITS Web Solutions
|
7 | 7 | Author URI: https://its.northeastern.edu
|
8 |
| -Version: 1.2.0 |
| 8 | +Version: 1.2.1 |
9 | 9 | */
|
10 | 10 |
|
11 | 11 | /**
|
|
15 | 15 | $nu_global_elements_options = get_option( 'nu_global_elements_option_name' );
|
16 | 16 |
|
17 | 17 | /**
|
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 |
19 | 19 | */
|
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 ' |
24 | 21 | <link rel="stylesheet" href="https://global-packages.cdn.northeastern.edu/global-elements/dist/css/index.css">
|
25 | 22 | <script src="https://global-packages.cdn.northeastern.edu/global-elements/dist/js/index.umd.js"></script>
|
26 | 23 | <script src="https://global-packages.cdn.northeastern.edu/kernl-ui/dist/js/index.umd.js" defer></script>
|
27 | 24 | ';
|
28 | 25 |
|
29 |
| - }); |
30 |
| -} |
31 |
| - |
32 | 26 | /**
|
33 | 27 | * Include the global NU header, if it is not disabled in the options
|
34 | 28 | *
|
|
65 | 59 | */
|
66 | 60 |
|
67 | 61 | 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 | + } |
72 | 73 | }
|
73 | 74 |
|
74 | 75 |
|
|
0 commit comments