Provides a shortcode, widget, and functions for displaying UCF news.
This plugin provides a shortcode, widget, and helper functions for displaying news stories from UCF Today. It is written to work out-of-the-box for non-programmers, but is also extensible and customizable for developers.
Head over to the UCF News Plugin wiki for detailed information about this plugin, installation instructions, and more.
Enhancements:
- Added composer file.
Enhancements:
- Explicitly unset underline styles on news item links to reduce visual clutter in anticipation of themes updating to Athena v1.1.1. Added underlines on hover/focus where there are no other visual differences in those states.
- Replaced usage of nonexistent
.text-smallclass in external stories default layout with.font-size-sm - Upgraded packages
Enhancements:
-
Updated all [ucf-news-feed] layouts provided out-of-the-box to utilize Athena Framework classes. This is a breaking change--please read below ("Upgrade Notice") for details before upgrading this plugin in production.
This update will make it easier to maintain layouts moving forward, and provides a performance benefit by no longer needing to enqueue an additional stylesheet on every front-facing post/page.
-
Removed the "Include Default CSS" plugin option and associated stylesheet.
-
Upgraded packages, and removed packages and gulp tasks related to CSS minification.
Bug Fixes:
- Fixed an issue where Today stories with a video header (and, therefore, an oembed poster as a thumbnail) would never display a thumbnail in [ucf-news-feed] layouts.
Upgrade Notice:
-
A theme that includes the Athena Framework is now required for layouts provided by the plugin to display as intended.
You should be able to safely upgrade to v3.0.0 of this plugin if your site meets all of the following criteria:
- Your site uses the UCF WordPress Theme v0.7.2+, Colleges Theme v1.1.2+, or any other WordPress theme that includes the Athena Framework v1.1.0+
- Your site does not reference existing CSS classes from the "classic", "modern" or "card" layouts (such as
.ucf-news-item,.ucf-news-thumbnail) in custom layouts, markup on posts/pages, or markup within your theme or another plugin
However, we recommend testing this upgrade in a development/QA environment before upgrading in production.
If your site does include references to CSS classes from the "classic", "modern" or "card" layouts and depends on them for styling, you should update or remove them prior to upgrading this plugin.
If your site's active theme does not include the Athena Framework, you can still override and/or define your own custom layouts as needed.
Bug Fixes:
- Added default
searchoption value toUCF_News_Config::$default_options, fixing some undefined index notices.
Enhancements:
- Added new
searcharg for the[ucf-news-feed]shortcode, which allows you to filter results by a search query. - Tidied up
UCF_News_Feed::get_news_items()and adjustedUCF_News_Feed::format_tax_arg()a bit to omit unset/empty query args from the final feed URL that's requested, and support custom feed URLs that already include query args. - Upgraded packages
Bug fixes:
- Added missing
show_imagefield for the news widget, and updated widget update logic to ensure its value is saved properly (and ensures images are shown by default in layouts that support them).
Enhancements:
- Admin options page improvements (props @strmtrpr83):
- Added the WordPress CSS class 'large-text' to both feed URL inputs so the whole feed URL is visible.
- Hid the Fallback Image preview img tag when there is no URL instead of showing a broken image tag.
- Updated the
tag: added alt text, removed the hard coded 'width' / 'height' and set 'max-width' and 'max-height' to 150px. This keeps the image from distoring in case the user selects a non square image and makes the image preview a little larger.
- Added the built in WordPress button CSS classes 'btn' and 'btn-primary' to the Upload link to make it a button.
- Changed the 'Upload' text to 'Add Image' when no fallback image is selected. It will automatically change to 'Change Image' when a fallback image is selected.
- Changed the 'Upload Image' text in the Media Library pop-up to 'Select Image'. It's more inline with the final user action.
- Added text for the user when no fallback image has been selected. Before the broken img tag could be cosntrued as an image being selected but failing to load. This message will automatically hide on adding/selecting an image.
- Added a 'Remove Image' button that will hide the preview img tag, set the ucf_news_fallback_image hidden field to '', display the no fallback image text, hide the 'Remove Image' button and change the 'Change Image' button back to say 'Add Image'.
Enhancements:
- Added a
show_imageoption to theucf-news-feedshortcode, specifically used by thecardlayout. When set to false, the image from the feed will not be displayed. - Added the
ucf-statementsshortcode, which provides a way of listingstatementposts from the News website. - Added the
classiclayout for theucf-statementsshortcode.
Enhancements:
- Added
width/heightattributes to<img>tags in this plugin's provided layouts that utilize story thumbnails. Themes and other plugins can utilizeUCF_News_Common::get_story_img_tag()to display thumbnails with these attributes applied in custom layouts. - Updated required files in main plugin files to use absolute paths.
- Upgraded packages
Upgrade notice:
- PHP 7.x is now required.
Bug Fixes:
- Updated to ensure the
ucf_external_stories_feed_urlhas a default value even if there isn't one in the options table.
Enhancements:
- Added ucf-external-stories shortcode.
Enhancements:
- Added functions for retrieving a news story's primary category (section) and tag (topic)
- Updated the "modern" news list layout to display the story's primary category (section), if available
- Added plugin version number to enqueued plugin assets for cache-busting purposes
- WordPress Shortcode Interface integration improvements:
- Added missing
offsetparam to WP SCIF shortcode registration - Fixed descriptions for
sectionsandtopicsparams to note that term slugs are expected (not IDs)
- Added missing
- Updated repo packages; added linter configs; added Github issue templates and CONTRIBUTING doc
Enhancements:
- Removed usage of
create_function()throughout the plugin for improved compatibility with newer versions of PHP. - Updated today.ucf.edu references in the plugin to ucf.edu/news/
Enhancements:
- Added ability to override the default URL per shortcode, specifically so the
main-site-storiesfeed on /news/ can be used.
Enhancements:
- In preparation for a rebuilt UCF Today site,
UCF_News_Common::get_story_image_or_fallback()has been modified to prioritize the customthumbnailfeed value when retrieving a story's image. If thethumbnailvalue isn't present in the feed, WordPress's standard media details will be referenced, like before, and the "medium" thumbnail size is returned instead. - Updated
.ucf-news-thumbnail-imageclass to force thumbnails to span the full width of their parent container (in case a very small thumbnail is returned for some reason).
Enhancements:
- Removed duplicate hard-coded default feed url values throughout the plugin
Bug Fixes:
- Updated default
ucf_news_feed_urloption value to exclude "/posts/", so this url works out-of-the-box - Fixed handling of invalid feed results in provided news layouts: layouts now avoid accessing non-existent object properties when feed results return
false.
Enhancements:
- Added Github Plugin URI to allow for installation from Github plugin.
Bug Fixes:
- Added missing default
offsetvalue inUCF_News_Config::$default_options - Updated widget markup to respect
before_widgetandafter_widgetmarkup defined in themes
Enhancements:
- Added http_timeout setting to allow for adjustment.
Bug Fixes:
- Added some hardening to
UCF_News_Common::get_story_image_or_fallback()to account for stories that may have an invalid$featured_mediaobject/broken thumbnails - Fixed typo in plugin deactivation function name
- Fixed WP Shortcode Interface registration
Enhancements:
- Added conditional WP Shortcode Interface preview styles
Bug Fixes:
- Added activation and deactivation hooks to handle default options.
Enhancements:
- Added
$fallback_messageparameter to allow a no results message to be customized. Add the message by inserting it in between the opening and closing shortcodes (the content area), i.e.[ucf-news-feed]<insert message here>[/ucf-news-feed].
Enhancements:
- Updated
UCF_News_Common::display_news_items()to render layout parts using filters instead of actions. Please note this change is not backward-compatible with layouts registered using hooks provided by older versions of the plugin.
Bug Fixes:
- Fixed
display_news_items()inUCF_News_Commonnot being declared as a static method - Updated filtering of options in
UCF_News_Feed::get_news_items()to allow 0 values, fixing undefined index notices in some cases.
Enhancements:
- Updated mobile styles for card layouts.
Enhancements:
- Added modern and card layouts.
Bug Fixes:
- Make sure UCF_News_Feed::get_news_items() always has a feed_url set, even if the plugin option's value is empty (thanks @jorgedonoso!)
Bug Fixes:
- Updated to match the new query params available on UCF Today.
Bug Fixes:
- Updates the way the news feed is pulled to prevent error when accessing external host.
Enhancements:
- Adds empty alt tag to classic layout images for accessibility.
Bug Fixes:
- Corrects filter name from category to category_name.
Bug Fixes:
- Corrects a bug with sections and topics filters.
- Initial release
- v3.0.0: All layouts provided by the plugin require the Athena Framework to display as intended. More details
- v2.2.2: PHP 7.0+ is required.
Note that compiled, minified JS files are included within the repo. Changes to these files should be tracked via git (so that users installing the plugin using traditional installation methods will have a working plugin out-of-the-box.)
Enabling debug mode in your wp-config.php file is recommended during development to help catch warnings and bugs.
- node
- gulp-cli
-
Clone the UCF-News-Plugin repo into your local development environment, within your WordPress installation's
plugins/directory:git clone https://github.com/UCF/UCF-News-Plugin.git -
cdinto the new UCF-News-Plugin directory, and runnpm installto install required packages for development intonode_modules/within the repo -
Optional: If you'd like to enable BrowserSync for local development, or make other changes to this project's default gulp configuration, copy
gulp-config.template.json, make any desired changes, and save asgulp-config.json.To enable BrowserSync, set
synctotrueand assigntargetthe base URL of a site on your local WordPress instance that will use this plugin, such ashttp://localhost/wordpress/my-site/. Yourtargetvalue will vary depending on your local host setup.The full list of modifiable config values can be viewed in
gulpfile.js(seeconfigvariable). -
Run
gulp defaultto process front-end assets. -
If you haven't already done so, create a new WordPress site on your development environment to test this plugin against.
-
Activate this plugin on your development WordPress site.
-
Configure plugin settings from the WordPress admin under "UCF News".
-
Run
gulp watchto continuously watch changes to JS files. If you enabled BrowserSync ingulp-config.json, it will also reload your browser when plugin files change.
- This plugin's README.md file is automatically generated. Please only make modifications to the README.txt file, and make sure the
gulp readmecommand has been run before committing README changes. See the contributing guidelines for more information.
Want to submit a bug report or feature request? Check out our contributing guidelines for more information. We'd love to hear from you!