diff --git a/web/app/plugins/mitlib-pull-hours/src/class-display-widget-frontpage.php b/web/app/plugins/mitlib-pull-hours/src/class-display-widget-frontpage.php
index 0500b6ba..61b0e318 100644
--- a/web/app/plugins/mitlib-pull-hours/src/class-display-widget-frontpage.php
+++ b/web/app/plugins/mitlib-pull-hours/src/class-display-widget-frontpage.php
@@ -83,6 +83,43 @@ public static function init() {
register_widget( 'Mitlib\PullHours\Display_Widget_Frontpage' );
}
+ /**
+ * This function accepts the post ID of a location record, which will be used
+ * to check if that location has its alert populated. If either of the two
+ * fields for the location alert (alert_title or alert_content) are populated,
+ * that content will be shown in a div.
+ *
+ * The function does not return anything.
+ *
+ * @param string $location_id The ID of a location record to look up.
+ *
+ * @return void
+ */
+ public function location_alert( $location_id ) {
+ $allowed_html = array(
+ 'a' => array(
+ 'href' => array(),
+ ),
+ );
+
+ $query_args = array(
+ 'post_type' => 'location',
+ 'p' => $location_id,
+ 'post_status' => 'publish',
+ );
+ $locations = new \WP_Query( $query_args );
+
+ while ( $locations->have_posts() ) {
+ $locations->the_post();
+ $alert_frontpage = get_field( 'alert_frontpage' );
+ if ( $alert_frontpage ) {
+ echo '
';
+ }
+ }
+ }
+
/**
* Sanitize widget form values as they are saved.
*
diff --git a/web/app/plugins/mitlib-pull-hours/templates/display-widget-frontpage.php b/web/app/plugins/mitlib-pull-hours/templates/display-widget-frontpage.php
index 43cd8a17..fc01f848 100644
--- a/web/app/plugins/mitlib-pull-hours/templates/display-widget-frontpage.php
+++ b/web/app/plugins/mitlib-pull-hours/templates/display-widget-frontpage.php
@@ -6,41 +6,6 @@
* @since 0.6.0
*/
-/**
- * This function accepts the post ID of a location record, which will be used
- * to check if that location has its alert populated. If either of the two
- * fields for the location alert (alert_title or alert_content) are populated,
- * that content will be shown in a div.
- *
- * The function does not return anything.
- *
- * @param string $location_id The ID of a location record to look up.
- *
- * @return void
- */
-function location_alert( $location_id ) {
- $allowed_html = array(
- 'a' => array(
- 'href' => array(),
- ),
- );
-
- $query_args = array(
- 'post_type' => 'location',
- 'p' => $location_id,
- 'post_status' => 'publish',
- );
- $locations = new \WP_Query( $query_args );
- while ( $locations->have_posts() ) {
- $locations->the_post();
- $alert_frontpage = get_field( 'alert_frontpage' );
- if ( $alert_frontpage ) {
- echo '