diff --git a/README.md b/README.md index 1304a35..54c92ac 100755 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ A tool that makes it easy to embed dynamic course data from Kuali. +## What's new in v1.1 + +- Provides a default API url in the event that one is not supplied in the network settings +- Limits pulled courses to ones with active status +- Fixes an issue that caused the cache recency to not be honored + ## Example Usage ``[courses subject="COM"]`` @@ -12,6 +18,6 @@ __Contributors:__ [bjcfuller](https://github.com/bjcfuller), [alexandragauss](ht __Tags:__ plugins, shortcodes __Requires at least:__ 5.0 __Tested up to:__ 6.0.2 -__Stable tag:__ 1.0 +__Stable tag:__ 1.1 __License:__ GPL-3.0 __Licence URI:__ https://www.gnu.org/licenses/gpl-3.0.html diff --git a/inc/uri-kuali-api.php b/inc/uri-kuali-api.php index fd232fe..43b3591 100644 --- a/inc/uri-kuali-api.php +++ b/inc/uri-kuali-api.php @@ -122,13 +122,13 @@ function uri_kuali_api_get_courses( $id, $atts ) { /* Build URL for a list of courses if a course number isn't specified */ if (null === $atts['number']) { - $url = $api_base . '/cm/courses/queryAll?subjectCode=' . $id . '&sort=number&limit=' . $atts['limit']; + $url = $api_base . '/cm/courses/queryAll?subjectCode=' . $id . '&sort=number&limit=' . $atts['limit'] . '&status=active'; return uri_kuali_get_data( $url ); } /* If a course number is specified, build URL for single course */ else { - $url = $api_base . '/cm/courses/queryAll?subjectCode=' . $id . '&number=' . $atts['number']; + $url = $api_base . '/cm/courses/queryAll?subjectCode=' . $id . '&number=' . $atts['number'] . '&status=active'; return uri_kuali_get_data( $url ); } } diff --git a/inc/uri-kuali-helpers.php b/inc/uri-kuali-helpers.php index 1485595..27476fe 100644 --- a/inc/uri-kuali-helpers.php +++ b/inc/uri-kuali-helpers.php @@ -29,7 +29,10 @@ function uri_kuali_render_course_list( $courses, $attributes ) { print $attributes['before']; foreach( $courses as $course ) { - include $template; + //var_dump($course); + //if ( null === $course->dateStart || 'online' == $course->teachingMethod ) { + include $template; + //} } print $attributes['after']; @@ -80,7 +83,7 @@ function uri_kuali_hash_string ( $string ) { */ function uri_kuali_cache_is_expired( $date ) { - $recency = get_option( 'uri_kuali_recency', '1 day' ); + $recency = get_site_option( 'uri_kuali_recency', '1 day' ); $expiry = strtotime( '-' . $recency, strtotime('now') ); return ( $date < $expiry ); diff --git a/uri-kuali.php b/uri-kuali.php index bb598bc..fcbbe42 100755 --- a/uri-kuali.php +++ b/uri-kuali.php @@ -3,7 +3,7 @@ Plugin Name: URI Kuali Plugin URI: https://www.uri.edu Description: Implements a shortcode to display course data from Kuali's API. [courses subject="AAF"] -Version: 1.0 +Version: 1.1 Author: Brandon Fuller Author: Alexandra Gauss Author URI: