CREOL People API
Display people in a grid layout using data from the CREOL API.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ucf/creol-people-api/archive/refs/heads/main.zipReadme
CREOL People API
A WordPress plugin that displays people in a customizable grid layout using data from the CREOL API.
Description
The CREOL People API plugin provides a simple shortcode to display staff, faculty, alumni, or other personnel from the CREOL (College of Optics and Photonics) database. The plugin fetches data from the CREOL API and displays it in a responsive layout with customizable options.
Features
- Flexible Display Modes: Choose between card view (with images) or compact grid view
- Responsive Design: Automatically adapts to different screen sizes
- Smart Caching: Reduces API calls with configurable transient caching
- Group Filtering: Filter people by one or two group names
- Alumni Support: Display alumni personnel in table and grid modes
- Highly Customizable: Control columns, limits, color scheme, and display modes via shortcode attributes
Installation
From GitHub
-
Download the plugin files or clone this repository:
git clone https://github.com/UCF/CREOL-People-API.git -
Upload the
CREOL-People-APIfolder to your/wp-content/plugins/directory -
Activate the plugin through the 'Plugins' menu in WordPress
Manual Installation
- Download the ZIP file from the releases page
- In WordPress admin, go to Plugins > Add New > Upload Plugin
- Choose the ZIP file and click "Install Now"
- Activate the plugin
Usage
People Shortcode
Display all people from a specific group:
[creol_people_api grpname1="Faculty"]
Alumni Shortcode
Display alumni records (grid display):
[creol_alumni_api]
Table example:
[creol_alumni_api display="table"]
Advanced Examples
Display with two group filters:
[creol_people_api grpname1="Faculty" grpname2="Optics"]
Limit the number of results:
[creol_people_api grpname1="Staff" limit="6"]
[creol_alumni_api year="2023" limit="10"]
Use compact grid mode (no images):
[creol_people_api grpname1="Faculty" display="grid"]
Custom column layout:
[creol_people_api grpname1="Faculty" columns="4"]
[creol_alumni_api year="2020" columns="5"]
Combine multiple options:
[creol_people_api grpname1="Faculty" grpname2="Research" display="card" columns="3" limit="12"]
Custom cache duration (in seconds):
[creol_people_api grpname1="Staff" cache_ttl="600"]
[creol_alumni_api year="2019" cache_ttl="1200"]
Shortcode Attributes
People shortcode attributes:
| Attribute | Description | Default | Values |
|-----------|-------------|---------|--------|
| grpname1 | Primary group name to filter by | (empty) | Any group name |
| grpname2 | Secondary group name to filter by | (empty) | Any group name |
| limit | Maximum number of people to display | 0 (all) | Any positive integer |
| display | Display mode | card | card, grid |
| columns | Number of grid columns | 3 | 1 to 8 |
| cache_ttl | Cache duration in seconds | 300 (5 min) | Any positive integer |
| include_positions | Include specific positions | (empty) | Any position name |
| exclude_positions | Exclude specific positions | (empty) | Any position name |
| dark_mode | Set theme to dark | 0 | 0 (off) or 1 (on) |
Alumni shortcode attributes:
| Attribute | Description | Default | Values |
|-----------|-------------|---------|--------|
| year | Graduation year to filter by | (empty) | Any year in the (YYYY) format |
| degree | Degree type to filter by | (empty) | all (default), ms, phd |
| limit | Maximum number of people to display | 0 (all) | Any positive integer |
| display | Display mode | grid | table, grid, list |
| columns | Number of grid columns | 3 | 1 to 8 |
| cache_ttl | Cache duration in seconds | 300 (5 min) | Any positive integer |
| dark_mode | Set theme to dark | 0 | 0 (off) or 1 (on) |
Attribute Aliases
For convenience, the following aliases are supported (case-insensitive):
grpname1,grp1,GrpName1(all equivalent)grpname2,grp2,GrpName2(all equivalent)
Display Modes
Card Mode (people)
Shows a full card for each person including:
- Profile image
- Name
- Position/Title
- Email address
- Phone number
- Room number
Grid Mode (people)
Displays a compact grid without images, showing only:
- Name
- Position/Title
- Email address
- Phone number
- Room number
Grid Mode (alumni)
Display a compact grid without images, showing only:
- Name
- Program
- Semester
- Degree type
- Advisor
Table Mode (alumni)
Displays a responsive table containing:
- Name
- Program
- Semester
- Advisor
List Mode (alumni)
Displays a plain list showing:
- Name
- Program
- Semester
Styling
The plugin includes default styles that can be overridden in your theme. Key CSS classes:
.creol-people-grid- Main container.creol-people-grid-mode- Applied when using grid display mode.creol-person-card- Individual person card.creol-person-image- Image container.creol-person-body- Text content container.creol-person-name- Person's name.creol-person-position- Job title/position.creol-person-email- Email address.creol-person-phone- Phone number.creol-person-room- Room number.creol-alumni-grid- Alumni grid container.creol-alumni-table- Alumni table.creol-alumni-card- Alumni card
Custom CSS Example
/* Override card styles in your theme */
.creol-person-card {
border: 2px solid #000;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.creol-person-name {
color: #003366;
font-size: 1.2rem;
}
Caching
The plugin uses WordPress transients to cache API responses, reducing load times and API calls. The default cache duration is 5 minutes (300 seconds), but can be customized per shortcode using the cache_ttl attribute.
To clear the cache:
- Transients are automatically cleared after the TTL expires
- Manually delete transients using a plugin like "Transients Manager"
- Use WP-CLI:
wp transient delete --all
Requirements
- WordPress 5.0 or higher
- PHP 7.0 or higher
- Active internet connection to fetch data from CREOL API
Support
For bugs, feature requests, or contributions, please visit the GitHub repository.
Contributing
See CONTRIBUTING.md for guidelines on how to contribute to this plugin.
License
This plugin is licensed under GPL3. See the main plugin file for full license information.
Changelog
1.2.1
- Updated alumni fields
- New alumni display mode 'list'
- Patched 'local network access' bug
1.2.0
- Alumni shortcode support
- Grid and table display modes for alumni
- Minor UI/UX improvements
1.1.0
- Dark mode attribute
- Include/exclude positions
- Up to 8 cols
- Updated responsive design
- Minor UI/UX improvements
1.0.0
- Initial release
- Shortcode implementation with group filtering
- Card and grid display modes
- Responsive grid layout
- Transient caching support
- Customizable columns and limits
Credits
Developed by UCF Web Communications for the University of Central Florida.