|
1 | 1 | <?php
|
2 | 2 | /*
|
3 | 3 | Plugin Name: Northeastern Global Elements
|
4 |
| -Plugin URI: https://northeastern.netlify.app/pattern-library/page-chrome/global-elements/ |
| 4 | +Plugin URI: https://github.com/ITS-Digital-Technology/global-elements-wordpress |
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.1 |
| 8 | +Version: 1.2.2 |
9 | 9 | */
|
10 | 10 |
|
11 | 11 | /**
|
|
17 | 17 | /**
|
18 | 18 | * Include global elements CSS, kernl UI and javascript from CDN
|
19 | 19 | */
|
20 |
| -echo ' |
| 20 | +add_action('wp_head', function() { |
| 21 | + echo ' |
21 | 22 | <link rel="stylesheet" href="https://global-packages.cdn.northeastern.edu/global-elements/dist/css/index.css">
|
22 | 23 | <script src="https://global-packages.cdn.northeastern.edu/global-elements/dist/js/index.umd.js"></script>
|
23 | 24 | <script src="https://global-packages.cdn.northeastern.edu/kernl-ui/dist/js/index.umd.js" defer></script>
|
24 | 25 | ';
|
| 26 | +}); |
25 | 27 |
|
26 | 28 | /**
|
27 | 29 | * Include the global NU header, if it is not disabled in the options
|
|
57 | 59 | /**
|
58 | 60 | * Include TrustArc, if it is not disabled in the options
|
59 | 61 | */
|
60 |
| - |
61 | 62 | if (!isset($nu_global_elements_options['disable_trustarc'])){
|
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 { |
| 63 | + |
| 64 | + if (isset($nu_global_elements_options['disable_global_footer'])){ |
68 | 65 | 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 |
| - }); |
| 66 | + echo '<style>#trustarc-global-element footer {padding-top: .6rem !important;} #trustarc-global-element footer a {color: #ccc; text-decoration: none;}</style>'; |
| 67 | + }); |
72 | 68 | }
|
| 69 | + add_action('wp_footer', function() { |
| 70 | + echo '<div id="trustarc-global-element" x-data="NUGlobalElements.trustarc()" x-init="init()"></div>'; |
| 71 | + }); |
73 | 72 | }
|
74 | 73 |
|
75 |
| - |
76 | 74 | /**
|
77 | 75 | * Create plugin settings/options menu item, page and fields
|
78 | 76 | *
|
|
0 commit comments