Closed matt-bernhardt closed 2 years ago
(This thread of comments may get deleted prior to code review)
The first commit results in the following diff between the two bespoke page templates:
% diff page-exhibits-maihaugen-gallery.php page-exhibits-rotch-library.php
3c3
< * Template Name: Exhibits | Maihaugen Gallery
---
> * Template Name: Exhibits | Rotch Library
47c47
< 'value' => 'Maihaugen Gallery', // Value for comparison.
---
> 'value' => 'Rotch Library', // Value for comparison.
63d62
<
101c100
< 'value' => 'Maihaugen Gallery', // Value for comparison.
---
> 'value' => 'Rotch Library', // Value for comparison.
117d115
<
155c153
< 'value' => 'Maihaugen Gallery', // Value for comparison.
---
> 'value' => 'Rotch Library', // Value for comparison.
Why are these changes being introduced:
Relevant ticket(s):
https://mitlibraries.atlassian.net/browse/uxws-1396
How does this address that need:
This PR does several things in order:
Exhibits | Location Index
page template, derived from the existing Maihaugen and Rotch templates. Instead of having a hard-coded location value, however, it loads the targeted location from the post's Category assignments.functions.php
, allowing page templates to look up location information according to the new data model. The need for this helper function is driven by the fact that some exhibits will be placed in a catchall category, with the actual name of the location stored in a separate field. Additionally, some exhibits may be placed into multiple locations. Navigating all these conditionals seems like something for a helper function, rather than repeated logic across multiple page templates.Document any side effects to this change:
get_the_*
functions typically return strings rather than arrays. Given how related the return values are, however, and the need to have a single returned entity, I hope this is acceptable.How can a reviewer manually see the effects of these changes?
This branch has been deployed to the staging server.
Todo:
Requires new or updated plugins, themes, or libraries?
YES - there's a coordinated PR for the Custom Child Post Types plugin, which has also been deployed. MITLibraries/Custom-Child-Theme-Post-Types#5
Requires change to deploy process?
NO