Skip to content

Commit

Permalink
Merge pull request #213 from uriweb/hotfix-relative-urls
Browse files Browse the repository at this point in the history
Hotfix 2.4.1
  • Loading branch information
bjcfuller authored Jul 28, 2022
2 parents 5fa6478 + d5338bb commit b2c9349
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 79 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ rules:
- error
jsx-a11y/label-has-associated-control: warn
jsx-a11y/label-has-for: off
'@wordpress/no-global-event-listener': off # We might actually need to address this at some point.

# Specify global variables to ignore
# Some of these aren't really globals, but this is useful for ignoring no-undef for class vars etc.
Expand Down
8 changes: 4 additions & 4 deletions 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
?>

<main id="main" class="site-main" role="main">

<section class="error-404 not-found">
<div id="rhody404"></div>
<div class="content-404">
Expand All @@ -25,17 +25,17 @@
esc_html_e( 'We can&rsquo;t find what you&rsquo;re looking for, but you can try searching for it.', 'uri' );
?>
</p>

<div id="searchbox" role="search">
<form id="sb" method="get" action="https://www.uri.edu/search" name="global_general_search_form">
<form id="sb" method="get" action="https://<?php uri_modern_the_domain(); ?>/search" name="global_general_search_form">
<input type="hidden" name="cx" value="016863979916529535900:17qai8akniu" />
<input type="hidden" name="cof" value="FORID:11" />
<label id="sb-query-label" for="sb-query">Searchbox</label>
<input role="searchbox" name="q" id="sb-query" value="<?php print str_replace( array( '/', '-', '_' ), ' ', add_query_arg( array(), $wp->request ) ); ?>" type="text" placeholder="Search uri.edu" />
<input type="submit" id="sb-submit" class="searchsubmit" name="searchsubmit" value="Search" aria-label="Submit search" />
</form>
</div>

</div><!-- .page-content -->
</div>
</section><!-- .error-404 -->
Expand Down
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,18 @@
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/uriweb/uri-modern)](https://github.com/uriweb/uri-modern/releases/latest)
[![GitHub Release Date](https://img.shields.io/github/release-date/uriweb/uri-modern)](https://github.com/uriweb/uri-modern/releases/latest)
![GitHub](https://img.shields.io/github/license/uriweb/uri-modern)
[![Codacy Badge](https://img.shields.io/codacy/grade/cc0b943ef637481b87d3b17ff9f5b1c0/master)](https://www.codacy.com/app/uriweb/uri-modern?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=uriweb/uri-modern&amp;utm_campaign=Badge_Grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/fa900133ab854001a03182aa712eb6c2)](https://www.codacy.com/gh/uriweb/uri-modern/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=uriweb/uri-modern&amp;utm_campaign=Badge_Grade)
![GitHub top language](https://img.shields.io/github/languages/top/uriweb/uri-modern?color=violet&branch=master)

URI Modern is a WordPress theme designed for the University of Rhode Island. It's designed to replace all themes currently being used on the university's websites, and unify the online brand and experience.

## What's new in 2.4.0
## What's new in 2.4.1

URI Modern 2.4.0 is a minor release.
URI Modern 2.4.1 is a technical adjustment release.

* Adds a filter for dynamic control of the action bar "Apply" button
* Adds a Customizer option to switch the "Apply" button context from undergraduate to graduate
* Whitelists the [Ninja Tables](https://wordpress.org/plugins/ninja-tables/) block
* Makes it easier to edit `.breakout` elements in the block editor
* Makes it easier to read HTML and shortcode text in the block editor
* Updates ASCII art to reflect the State of Rhode Island name change
* Updates development tools
* Adds the ability to modify certain domains in hard-coded URLs using constants configured in `wp-config.php`

For complete details, see the [commit history](https://github.com/uriweb/uri-modern/pull/205/commits) and the [issue tracker](https://github.com/uriweb/uri-modern/issues).
For complete details, see the [commit history](https://github.com/uriweb/uri-modern/pull/213/commits) and the [issue tracker](https://github.com/uriweb/uri-modern/issues).

## How do I get set up?

Expand All @@ -39,6 +33,6 @@ __Contributors:__ [bjcfuller](https://github.com/bjcfuller), [johnpennypacker](h
__Tags:__ themes
__Requires at least:__ 4.0
__Tested up to:__ 5.6
__Stable tag:__ 2.4.0
__Stable tag:__ 2.4.1
__License:__ GPL-3.0
__Licence URI:__ https://www.gnu.org/licenses/gpl-3.0.html
38 changes: 19 additions & 19 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<?php
// connect
$link = array(
'href' => 'https://www.uri.edu/connect',
'href' => 'https://' . uri_modern_get_the_domain() . '/connect',
'id' => 'action-connect',
'text' => 'Connect',
'title' => 'Learn more about URI: Get in touch',
Expand All @@ -35,23 +35,23 @@

// apply
$link = array(
'href' => 'https://www.uri.edu/apply',
'href' => 'https://' . uri_modern_get_the_domain() . '/apply',
'id' => 'action-apply',
'text' => 'Apply',
);
echo uri_modern_action_bar_link( $link );

// tour
$link = array(
'href' => 'https://www.uri.edu/tour',
'href' => 'https://' . uri_modern_get_the_domain() . '/tour',
'id' => 'action-tour',
'text' => 'Tour',
);
echo uri_modern_action_bar_link( $link );

// give
$link = array(
'href' => 'https://www.uri.edu/give',
'href' => 'https://' . uri_modern_get_the_domain() . '/give',
'id' => 'action-give',
'text' => 'Give',
);
Expand All @@ -71,33 +71,33 @@
<input id="sb-university-toggle" type="radio" name="storagebin" value="university" role="presentation" checked>
<label for="sb-university-toggle" aria-label="Open the University footer menu when browsing on mobile."><span>University</span></label>
<ul role="menu" aria-label="The University footer menu.">
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/about/leadership/" role="menuitem">Leadership</a></li>
<li><a href="https://web.uri.edu/diversity/" role="menuitem">Diversity and Inclusion</a></li>
<li><a href="https://web.uri.edu/global/" role="menuitem">Global</a></li>
<li><a href="https://web.uri.edu/about/campuses/" role="menuitem">Campuses</a></li>
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/safety/" role="menuitem">Safety</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/about/leadership/" role="menuitem">Leadership</a></li>
<li><a href="https://<?php uri_modern_the_domain( 'web' ); ?>/diversity/" role="menuitem">Diversity and Inclusion</a></li>
<li><a href="https://<?php uri_modern_the_domain( 'web' ); ?>/global/" role="menuitem">Global</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/about/campuses/" role="menuitem">Campuses</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/safety/" role="menuitem">Safety</a></li>
</ul>
</div>
<div id="sb-campus-life">
<input id="sb-campus-life-toggle" type="radio" name="storagebin" value="campus-life" role="presentation">
<label for="sb-campus-life-toggle" aria-label="Open the Campus Life footer menu when browsing on mobile."><span>Campus Life</span></label>
<ul role="menu" aria-label="The Campus Life footer menu.">
<li><a href="https://web.uri.edu/housing/" role="menuitem">Housing</a></li>
<li><a href="https://web.uri.edu/dining/" role="menuitem">Dining</a></li>
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/athletics/" role="menuitem">Athletics and Recreation</a></li>
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/campus-life/health-and-wellness/" role="menuitem">Health and Wellness</a></li>
<li><a href="https://<?php uri_modern_the_domain( 'web' ); ?>/housing/" role="menuitem">Housing</a></li>
<li><a href="https://<?php uri_modern_the_domain( 'web' ); ?>/dining/" role="menuitem">Dining</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/athletics/" role="menuitem">Athletics and Recreation</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/campus-life/health-and-wellness/" role="menuitem">Health and Wellness</a></li>
<li><a href="https://events.uri.edu" role="menuitem">Events</a></li>
</ul>
</div>
<div id="sb-academics">
<input id="sb-academics-toggle" type="radio" name="storagebin" value="academics" role="presentation">
<label for="sb-academics-toggle" aria-label="Open the Academics footer menu when browsing on mobile."><span>Academics</span></label>
<ul role="menu" aria-label="The Academics footer menu.">
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/academics/" role="menuitem">Undergraduate</a></li>
<li><a href="https://web.uri.edu/graduate-school/" role="menuitem">Graduate</a></li>
<li><a href="https://web.uri.edu/advising/" role="menuitem">Advising</a></li>
<li><a href="https://web.uri.edu/library/" role="menuitem">Libraries</a></li>
<li><a href="https://web.uri.edu/career/students/" role="menuitem">Internships</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/academics/" role="menuitem">Undergraduate</a></li>
<li><a href="https://<?php uri_modern_the_domain( 'web' ); ?>/graduate-school/" role="menuitem">Graduate</a></li>
<li><a href="https://<?php uri_modern_the_domain( 'web' ); ?>/advising/" role="menuitem">Advising</a></li>
<li><a href="https://<?php uri_modern_the_domain( 'web' ); ?>/library/" role="menuitem">Libraries</a></li>
<li><a href="https://<?php uri_modern_the_domain( 'web' ); ?>/career/students/" role="menuitem">Internships</a></li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -127,7 +127,7 @@
</div>
<div id="tagline"></div>
<div id="legal">
<p>Copyright &copy; <a class="subtle" href="http://www.uri.edu/">University of Rhode Island</a> | University of Rhode Island, Kingston, RI 02881, USA | 1.401.874.1000</p>
<p>Copyright &copy; <a class="subtle" href="http://<?php uri_modern_the_domain(); ?>/">University of Rhode Island</a> | University of Rhode Island, Kingston, RI 02881, USA | 1.401.874.1000</p>
<p>URI is an equal opportunity employer committed to the principles of affirmative action.&nbsp;&nbsp;<a class="jobs" href="https://jobs.uri.edu/">Work at URI</a></p>
</div>
</footer><!-- #globalfooter -->
Expand Down
27 changes: 25 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,29 @@ function uri_modern_cache_buster() {
}


/**
* Returns the root domain to use
*
* @return str
*/
function uri_modern_get_the_domain( $sub = 'www' ) {

if ( 'web' === $sub ) {
return defined( 'URI_DOMAIN_WEB' ) ? URI_DOMAIN_WEB : 'web.uri.edu';
}

return defined( 'URI_DOMAIN_WWW' ) ? URI_DOMAIN_WWW : 'www.uri.edu';

}

/**
* Echos the root domain to use
*/
function uri_modern_the_domain( $sub = 'www' ) {
echo uri_modern_get_the_domain( $sub );
}


/**
* Returns the subdomain to use
*
Expand Down Expand Up @@ -590,7 +613,7 @@ function uri_modern_action_bar_link( $link ) {
function uri_modern_action_bar_filter_callback( $a ) {
$defaults = array(
'class' => '',
'href' => 'https://www.uri.edu/apply',
'href' => 'https://' . uri_modern_get_the_domain() . '/apply',
'id' => 'action-apply',
'text' => 'Apply',
'title' => '',
Expand All @@ -613,7 +636,7 @@ function uri_modern_action_bar_filter_callback( $a ) {

if ( $is_grad ) {
// it's a grad school page, override the link
$a['href'] = 'https://www.uri.edu/apply/graduate';
$a['href'] = 'https://' . uri_modern_get_the_domain() . '/apply/graduate';
$a['title'] = 'Apply with GradCAS';
}
}
Expand Down
28 changes: 14 additions & 14 deletions header-parts/brandbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@
?>

<header id="brandbar" class="site-header" role="banner">

<div id="identity-print"><img src="<?php echo get_template_directory_uri() . '/images/logo-print.png'; ?>" width="120px" alt="University of Rhode Island"></div>

<div id="globalsearch" role="search">
<input type="checkbox" id="gsform-toggle" role="presentation" aria-label="Toggle visibility of the search box.">
<label for="gsform-toggle" id="gsform"><span>Search</span></label>
<form id="gs" method="get" action="https://www.uri.edu/search" name="global_general_search_form">
<form id="gs" method="get" action="https://<?php uri_modern_the_domain(); ?>/search" name="global_general_search_form">
<input type="hidden" name="cx" value="016863979916529535900:17qai8akniu" />
<input type="hidden" name="cof" value="FORID:11" />
<label id="gs-query-label" for="gs-query">Searchbox</label>
<input role="searchbox" name="q" id="gs-query" value="<?php print ( isset( $_GET['q'] ) ) ? htmlentities( $_GET['q'] ) : ''; ?>" type="text" placeholder="Search" />
<input type="submit" id="gs-submit" class="searchsubmit" name="searchsubmit" value="Search" />
</form>
</div>

<div id="globalbanner-wrapper">
<div id="globalbanner">
<a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/" title="University of Rhode Island"><div id="identity">University of Rhode Island</div></a>
<a href="https://<?php uri_modern_the_domain(); ?>/" title="University of Rhode Island"><div id="identity">University of Rhode Island</div></a>

<div id="gateways">
<input type="checkbox" id="gateways-toggle" role="presentation" aria-label="Open the audience gateways menu when browsing on mobile">
<label for="gateways-toggle" id="gateways-label"><span><?php echo ( defined( 'URI_EASTER_EGGS' ) && URI_EASTER_EGGS === true ) ? '&#128017' : 'You'; ?></span></label>
<ul id="gateways-menu" role="menu">
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/gateway/future-students" role="menuitem">Future Students</a></li>
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/gateway/students" role="menuitem">Students</a></li>
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/gateway/faculty" role="menuitem">Faculty</a></li>
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/gateway/staff" role="menuitem">Staff</a></li>
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/gateway/families" role="menuitem">Parents and Families</a></li>
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/gateway/alumni" role="menuitem">Alumni</a></li>
<li><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/gateway/community" role="menuitem">Community</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/gateway/future-students" role="menuitem">Future Students</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/gateway/students" role="menuitem">Students</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/gateway/faculty" role="menuitem">Faculty</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/gateway/staff" role="menuitem">Staff</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/gateway/families" role="menuitem">Parents and Families</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/gateway/alumni" role="menuitem">Alumni</a></li>
<li><a href="https://<?php uri_modern_the_domain(); ?>/gateway/community" role="menuitem">Community</a></li>
</ul>
</div>

</div>
</div>

Expand Down
12 changes: 6 additions & 6 deletions header-parts/globalnav.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<input type="checkbox" id="globalnav-toggle" role="presentation" aria-label="Open the global navigation menu when browsing on mobile">
<label for="globalnav-toggle" id="globalnav-label">Main Menu <span role="presentation">open/close</span></label>
<ul id="globalnav-menu" class="content-width" role="menu">
<li role="menuitem"><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/admission">Admission</a></li>
<li role="menuitem"><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/academics">Academics</a></li>
<li role="menuitem"><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/research">Research</a></li>
<li role="menuitem"><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/campus-life">Campus Life</a></li>
<li role="menuitem"><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/about">About</a></li>
<li role="menuitem"><a href="https://<?php uri_modern_the_subdomain(); ?>.uri.edu/giving">Giving</a></li>
<li role="menuitem"><a href="https://<?php uri_modern_the_domain(); ?>/admission">Admission</a></li>
<li role="menuitem"><a href="https://<?php uri_modern_the_domain(); ?>/academics">Academics</a></li>
<li role="menuitem"><a href="https://<?php uri_modern_the_domain(); ?>/research">Research</a></li>
<li role="menuitem"><a href="https://<?php uri_modern_the_domain(); ?>/campus-life">Campus Life</a></li>
<li role="menuitem"><a href="https://<?php uri_modern_the_domain(); ?>/about">About</a></li>
<li role="menuitem"><a href="https://<?php uri_modern_the_domain(); ?>/giving">Giving</a></li>
</ul>
2 changes: 1 addition & 1 deletion inc/get-breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function uri_modern_breadcrumbs() {
$crumbs = array();

$option_val = get_option( 'breadcrumbs_prepend' );
$default = 'The University of Rhode Island' == get_bloginfo( 'name' ) ? '' : '[URI](https://www.uri.edu)';
$default = 'The University of Rhode Island' == get_bloginfo( 'name' ) ? '' : '[URI](https://' . uri_modern_get_the_domain() . ')';
$prepend = empty( $option_val ) ? array( $default ) : explode( "\n", $option_val );

foreach ( $prepend as $l ) {
Expand Down
4 changes: 2 additions & 2 deletions js/script.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uri-modern",
"version": "2.4.0",
"version": "2.4.1",
"description": "URI Modern is a WordPress theme designed for the University of Rhode Island. It's designed to replace all themes currently being used on the university's websites, and unify the online brand and experience.",
"themeName": "URI Modern",
"textDomain": "uri",
Expand Down
Loading

0 comments on commit b2c9349

Please sign in to comment.