Provides a custom post type, shortcode and functions for displaying Sections.
Adds a new post type called Sections that can be added to pages using a [ucf-section]
shortcode. Sections will display content from within the WordPress editor.
The [ucf-section]
shortcode has several options:
slug
- the slug of the section to be displayedid
- the ID of the section to be displayed (as an alternative to providing theslug
attribute)class
- CSS class(es) to assign to the generated<section>
element. By default, sections will always have the.ucf-section-SLUG
class assigned to them.title
- a descriptive title to use both as an accessiblearia-label
value for screenreaders in the generated<section>
element, and in navbar links generated by the Automatic Sections Menu Shortcode.section_id
- a value to assign as theID
attribute of the generated<section>
element.random_from_tag
- if provided a tag slug, a random section will be chosen to display from sections that are assigned the given tag.
- Upload the plugin files (unzipped) to the
/wp-content/plugins
directory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the "Plugins" screen in WordPress
$ wp plugin install --activate https://github.com/UCF/UCF-Section-Plugin/archive/master.zip
. See WP-CLI Docs for more command options.
Enhancements:
- Added composer file.
Bug Fixes:
- Fixed issue where css was not added to colleges post type.
Bug Fixes:
- Replaces
wp_make_content_images_responsive
withwp_filter_content_tags
, which was introduced in WP 5.5. - Keeps call to the old function if the new one doesn't exist for backwards compatibility.
Enhancements:
- Modified filtering options for files that are selectable from the media library modal when choosing a CSS or JS file for a page/post. Both CSS and JS will now be filtered by their respective file extensions by default (to filter out other files with the
text/plain
type), CSS filtering now includes thetext/plain
type, and JS filtering now includes thetext/javascript
type. - Updated packages.
Bug Fixes:
- Updated npm packages
- Fixed an issue where get_post_sections() throws notice
- Added responsive images with wp_make_content_images_responsive()
Bug Fixes:
- Ensure that styles and scripts are loaded when using random shortcode attribute
Enhancements:
- Added
random_from_tag
shortcode attribute and logic that enables a random section to be displayed from the given tag slug - Upgraded packages and gulpfile
- Added linter configs, Github issue/PR templates, and CONTRIBUTING doc to repo
Bug Fixes:
- Updated logic and provided an additional help function for processing sections in content outside of the main post_content
Bug Fixes:
- Added null check to suppress a warning that was bring thrown.
- Added logic to handle non-content sections.
Bug Fixes:
- Updated critical syntax error that prevented sections from being able to be displauyed on their template pages.
Enhancements:
- Various changes to the way front end assets are enqueued for sections for faster loading.
Bug Fixes:
- Corrected a minor issue with a regex.
Enhancements:
- Updated section plugin to automatically add the text from the first heading it finds into an
aria-label
attribute on the section.
Bug Fixes:
- Disabled archives by default.
Bug Fixes:
- Added missing CSS and JS file upload capability out-of-the-box
Bug Fixes:
- Fixed some notices thrown by
UCF_Section_Common::get_post_sections()
when the global$post
object is not available (e.g. on category/tag archives, or when a 404 is returned).
Enhancements:
- Added missing plugin description
- Updated available shortcode attributes in readme
Enhancements:
- Added unique classes to sections
- Added
role
andaria-label
attributes to sections that provide a title - Updated
UCF_Section_Common::get_post_sections()
to use the current$post
object if$post
is a section, allowing section-specific css/js to be loaded insingle-ucf_section.php
theme templates.
Bugfixes:
- Added missing
data-section-link-title
attributes to sections for compatibility with the Sections Menu Shortcode Plugin.
Enhancements:
- Added stylesheet and javascript field for sections
- Added mechanism for enqueuing the stylesheets to section specific tags in the head
- Added mechanism for enqueuing the javascripts to section specific tags in the footer
Enhancements:
- Added the ability to add css classes to the section wrapper.
- Added the ability to define the id of the section wrapper.
- Added the ability to add a title to the section wrapper (which can be used in templates to define the menu text).
Bug Fixes:
- Corrects incorrect sections being returned when providing a slug instead of an id.
Bug Fixes:
- Fixes #2 by parsing
$labels
args and setting them to variables. - Fixes #1 by renaming the non-existent
$output
variable to$before
,$content
and$after
respectively. - Adds additional comments.
- Initial release
n/a
None
- None