Skip to content

Commit a121ad9

Browse files
Housekeeping
1 parent 8c19161 commit a121ad9

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

nu_global_elements.php

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,50 +13,32 @@
1313
const NU_GLOBAL_ELEMENTS_PLUGIN_VER = "1.4.0";
1414
const NU_GLOBAL_ELEMENTS_PLUGIN_MANIFEST_URL = "https://its-digital-technology.github.io/global-elements-wordpress/manifest/info.json";
1515

16+
1617
/**
1718
* Get options values for plugin
1819
*/
1920

2021
$nu_global_elements_options = get_option( 'nu_global_elements_option_name' );
2122

23+
2224
/**
2325
* Include global elements CSS, kernl UI and javascript from CDN on front end
2426
*/
27+
2528
add_action('wp_head', function() { ?>
2629
<link rel="stylesheet" href="https://global-packages.cdn.northeastern.edu/global-elements/dist/css/index.css">
2730
<script src="https://global-packages.cdn.northeastern.edu/global-elements/dist/js/index.umd.js"></script>
2831
<script src="https://global-packages.cdn.northeastern.edu/kernl-ui/dist/js/index.umd.js" defer></script>
2932
<?php });
3033

34+
3135
/**
3236
* Include the global NU header, if it is not disabled in the options
3337
*
3438
* NOTE: There must be a wp_body_open() statement under the <body> tag,
3539
* most likely in header.php of the theme.
3640
*/
37-
/*
38-
if (!isset($nu_global_elements_options['disable_global_header'])) {
3941

40-
add_action('wp_body_open', function() use ($nu_global_elements_options) {
41-
42-
// Determine whether to show the wordmark
43-
$show_wordmark = isset($nu_global_elements_options['show_nu_wordmark']) && $nu_global_elements_options['show_nu_wordmark'];
44-
45-
// Create the x-data attribute dynamically
46-
$x_data = sprintf(
47-
'x-data="NUGlobalElements.header({ wordmark: %s })"',
48-
$show_wordmark ? 'true' : 'false'
49-
);
50-
51-
// Output the HTML structure
52-
echo sprintf(
53-
'<div %s x-init="init()" style="height: 48px; background-color: black"></div>',
54-
$x_data
55-
);
56-
57-
}, 10);
58-
}
59-
*/
6042
if (!isset($nu_global_elements_options['disable_global_header'])) {
6143

6244
add_action('wp_body_open', function() use ($nu_global_elements_options) {
@@ -88,19 +70,21 @@
8870
}
8971

9072

91-
9273
/**
9374
* Include the global NU footer, if it is not disabled in the options
9475
*/
76+
9577
if (!isset($nu_global_elements_options['disable_global_footer'])) {
9678
add_action('wp_footer', function() {
9779
echo '<div x-data="NUGlobalElements.footer()" x-init="init()"></div>';
9880
});
9981
}
10082

83+
10184
/**
10285
* Include TrustArc, if it is not disabled in the options
10386
*/
87+
10488
if (!isset($nu_global_elements_options['disable_trustarc'])){
10589

10690
if (isset($nu_global_elements_options['disable_global_footer'])){
@@ -128,6 +112,7 @@ function nu_global_elements_admin($hook) {
128112
wp_enqueue_style('nu-global-elements-admin', plugins_url('nu-global-elements-admin.css', __FILE__ ));
129113
}
130114

115+
131116
/**
132117
* Create plugin settings/options menu item, page and fields
133118
*
@@ -355,7 +340,6 @@ function nu_global_elements_link( $links ) {
355340
* Check for updates to this plugin and if available allow updating through WP admin plugin manager
356341
*/
357342

358-
359343
if( ! class_exists( 'UpdateChecker' ) ) {
360344

361345
class UpdateChecker{

0 commit comments

Comments
 (0)