dominik317 / team-members-directory
Team Members Directory plugin
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:wordpress-plugin
pkg:composer/dominik317/team-members-directory
Requires
- php: >=8.1
Requires (Dev)
- phpunit/phpunit: ^10.0
README
WordPress plugin for managing and displaying team members with Themosis Framework conventions.
Requirements
- PHP: >= 8.1
- WordPress: >= 6.0
- Themosis Framework: 3.1 (conventions followed)
- Composer: >= 2.0
- ACF Plugin: Required
Installation
Method 1: Drop-in Installation
- Copy plugin folder to
wp-content/plugins/team-members-directory - Run
composer installin plugin directory - Activate plugin in WordPress admin
- Install and activate ACF plugin
- Flush permalinks: Settings → Permalinks → Save Changes
Method 2: Composer Installation
Step 1: Ensure your WordPress project's composer.json has composer/installers configured:
{
"require": {
"composer/installers": "^2.0"
},
"extra": {
"installer-paths": {
"wp-content/plugins/{$name}/": ["type:wordpress-plugin"]
}
}
}
Step 2: Install the plugin:
composer require dominik317/team-members-directory
This will automatically install the plugin to wp-content/plugins/team-members-directory/
Step 3: Complete setup:
- Activate the plugin in WordPress Admin → Plugins
- Install and activate Advanced Custom Fields (ACF) plugin
- Flush permalinks: Settings → Permalinks → Save Changes
Usage
Creating Team Members
- Go to Team Members → Add New in WordPress admin
- Fill required fields:
- Full Name (required)
- Role/Title (required)
- Email (optional, validated)
- Photo (optional)
- Bio (optional)
- Click Publish
Displaying Team Members
Shortcode (embed anywhere):
[team_members]
[team_members limit="6" order="DESC"]
Dedicated Route:
https://yoursite.com/team
In PHP Templates:
<?php echo do_shortcode('[team_members]'); ?>
Configuration
Edit config/team.php:
return [ 'route_slug' => 'team', // URL: /team 'shortcode' => 'team_members', // Shortcode name ];
Filter for custom route slug:
add_filter('team_members_route_slug', function() { return 'our-team'; // Changes to /our-team });
Architecture Notes
This plugin follows Themosis Framework conventions while remaining installable as a standard WordPress plugin. Key decisions:
- WordPress hooks over ServiceProvider - Uses
add_action/add_filterinstead of Themosis ServiceProvider to maintain standard plugin compatibility - WordPress Rewrite API for routes - Custom
/teamroute uses WP Rewrite API since Themosis routing requires Application instance unavailable in standard plugins - ACF for fields - Programmatic field registration with graceful degradation if ACF is missing
- Controller pattern - Shared
TeamMemberControllerused by both shortcode and route (DRY principle) - Static methods - Simpler API for services/controllers, suitable for plugin scope
Project Structure
src/
├── Admin/ # Field registration & validation
├── Controllers/ # Business logic
├── PostTypes/ # CPT registration
├── Routes/ # Custom route handling
├── Services/ # Validation service
└── Shortcodes/ # Shortcode handler
views/ # Display templates
assets/css/ # Frontend styles
config/ # Configuration
tests/ # PHPUnit tests
Testing
Run unit tests:
composer test
Coverage: 7 tests, 16 assertions (TeamMemberValidator service)
Screenshots
Admin Interface
Team Members List:
Add/Edit Team Member:
Validation Errors:
Frontend Display
Shortcode Output & Route Output (/team):
Shortcode Output & Route Output (/team) on Mobile:
Author
Dominik Sopic | Version 0.1.0




