Work Plan Manager
Wordpress plugin to manage TTS network workplans
by KC Web Programmers · github.com/drafthorsestudio/work-plan-manager
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/drafthorsestudio/work-plan-manager/archive/refs/heads/main.zipWork Plan Manager WordPress Plugin
A comprehensive WordPress plugin that provides an alternate interface to manage three related post types (Work Plans, Goals, and Objectives). The plugin works with existing ACF field configurations and post types to streamline data entry and allow administrators to manage everything on one admin page.
Features
- Streamlined Interface: Manage Work Plans, Goals, and Objectives from a single admin page
- Role-Based Access Control: Integration with PublishPress Permissions for group-based access
- Works with Existing Setup: Uses your existing post types, taxonomies, and ACF field configurations
- Real-Time Preview: React-based preview interface showing data relationships
- Export Functionality: Export completed work plans to Excel or CSV format
- Responsive Design: Clean, modern interface that works on all devices
- Data Validation: Built-in validation for unique goal letters and objective numbers
Requirements
System Requirements
- PHP: 7.4 or higher
- WordPress: 5.0 or higher
- MySQL: 5.6 or higher
Required Plugins
- Advanced Custom Fields (ACF): Free or Pro version with existing field configurations
Required Post Types (must already exist)
workplan- Work Plan post typeworkplan-goal- Work Plan Goal post typeworkplan-objective- Work Plan Objective post type
Required Taxonomies (must already exist)
grant-year- Grant Year taxonomy (hierarchical)group- Group taxonomy for role-based access
Required ACF Fields (must already exist)
The plugin expects these ACF fields to be configured:
Work Plan Fields:
internal_status- Select field (Draft, Submitted, Approved, Locked)related_work_plan_goals- Relationship field to workplan-goal posts
Work Plan Goal Fields:
goal_letter- Select field (A-Z)goal_description- Textarea fieldwork_plan_objectives- Relationship field to workplan-objective posts
Work Plan Objective Fields:
objective_number- Number fieldobjective_description- Textarea fieldtimeline_description- Text field (moved from Goals)measureable_outcomes- Textarea field (new field)objective_outputs- Repeater field with:output_letter- Text fieldoutput_description- Textarea field
Data Structure Notes
The plugin uses ACF relationship fields to connect the post types:
- Work Plans contain a
related_work_plan_goalsfield that links to multiple Goal posts - Goals contain a
work_plan_objectivesfield that links to multiple Objective posts - Objectives contain timeline and measurable outcomes information
- This creates a parent-to-child relationship structure (Work Plan → Goals → Objectives)
- The plugin does NOT use WordPress's built-in post parent functionality
Field Structure Changes
Recent updates have modified the field structure:
- ✅ Grant quarters eliminated - Only grant year taxonomy is used (no sub-levels)
- ✅ Timeline moved -
timeline_descriptionmoved from Goals to Objectives - ✅ New field added -
measureable_outcomestextarea added to Objectives - ✅ Duplicate validation - Built-in checks prevent duplicate goal letters, objective numbers, and output letters
Optional Plugins
- PublishPress Permissions: For role-based access control
Installation
-
Ensure Prerequisites
- Verify all required post types, taxonomies, and ACF fields exist
- Ensure Advanced Custom Fields is installed and active
-
Upload Plugin Files
/wp-content/plugins/work-plan-manager/ ├── work-plan-manager.php (main plugin file) ├── css/ │ └── work-plan-manager.css ├── js/ │ └── work-plan-manager.js └── includes/ ├── admin-page.php ├── export-handler.php ├── utility-functions.php ├── installation.php └── acf-behaviors.php (optional) -
Activate the Plugin
- Go to WordPress Admin → Plugins
- Find "Work Plan Manager" and click "Activate"
- The plugin will check for required dependencies and show warnings if anything is missing
-
Optional: Enable ACF Field Enhancements
- If you want additional validation and automation features
- Edit
work-plan-manager.phpand uncomment this line:// require_once WPM_PLUGIN_PATH . 'includes/acf-behaviors.php'; - This adds validation for unique goal letters/objective numbers and auto-populates taxonomies
-
Configure Permissions
- The plugin adds
manage_workplanscapability to administrators - Add this capability to other roles as needed
- The plugin adds
Post Types and Taxonomies
Custom Post Types
-
Work Plan (
workplan)- Main container for all related goals and objectives
- Contains basic information and status tracking
-
Work Plan Goal (
workplan-goal)- Child of Work Plan
- Represents individual goals within a work plan
- Each goal has a letter designation (A, B, C, etc.)
-
Work Plan Objective (
workplan-objective)- Child of Work Plan Goal
- Represents specific objectives under each goal
- Each objective has a numeric designation (1, 2, 3, etc.)
- Contains repeatable outputs
Custom Taxonomies
-
Grant Year (
grant-year)- Hierarchical taxonomy
- Level 1: Years (Y1, Y2, Y3, etc.)
- Level 2: Quarters (Q1, Q2, Q3, Q4)
-
Group (
group)- Non-hierarchical taxonomy
- Used for role-based access control
- Maps to PublishPress user groups
Custom Fields (ACF)
Work Plan Fields
- Internal Status: Select field with options (Draft, Submitted, Approved, Locked)
Work Plan Goal Fields
- Goal Letter: Select field (A-Z)
- Goal Description: Textarea for detailed description
- Timeline Description: Text field for timeline information
- Work Plan Relationship: Relationship field linking to parent Work Plan
Work Plan Objective Fields
- Objective Number: Number field (1-100)
- Objective Description: Textarea for detailed description
- Objective Outputs: Repeater field containing:
- Output Letter: Text field (a, b, c, etc.)
- Output Description: Textarea
- Goal Relationship: Relationship field linking to parent Goal
- Work Plan Relationship: Relationship field linking to parent Work Plan
Usage
Accessing the Plugin
- Navigate to Work Plans in the WordPress admin menu
- The main interface will load with options to create or select existing work plans
Creating a New Work Plan
- Click "Add New Work Plan" button
- Fill in the required fields:
- Work Plan Title
- Grant Year and Quarter
- Group (based on your permissions)
- Internal Status
- Click "Save Work Plan"
Adding Goals
- After saving a Work Plan, the Goals section will appear
- Click "Add New Goal" to create a goal
- Fill in the goal information:
- Goal Title
- Goal Letter (automatically assigned)
- Goal Description
- Timeline Description
- Click "Save Goal"
Adding Objectives
- After saving a Goal, click "Add Objective"
- Fill in the objective information:
- Objective Title
- Objective Number (automatically assigned)
- Objective Description
- Add outputs using the "Add Output" button
- Click "Save Objective"
Managing Existing Work Plans
- Use the dropdown to select an existing Work Plan
- Click "Load Work Plan" to edit
- Make changes as needed
- Save individual components as you work
Exporting Work Plans
- Complete your Work Plan with all Goals and Objectives
- View the real-time preview at the bottom of the page
- Click "Export to Excel" or "Export to CSV"
- Download will begin automatically
Role-Based Access Control
Setting Up Groups
If using PublishPress Permissions:
-
Create Groups
- Go to PublishPress → Groups
- Create groups matching your organizational structure
- Examples: "Great Lakes ATTC", "Mid-America ATTC"
-
Assign Users to Groups
- Edit user profiles
- Assign appropriate groups
-
Map Groups to Roles The plugin automatically maps these role metagroup_ids:
great_lakes_editor→ "Great Lakes ATTC"mid_america_editor→ "Mid-America ATTC"central_east_editor→ "Central East ATTC"
Permission Structure
Administrators (users with edit_others_workplans capability):
- ✅ Can see ALL Work Plans, Goals, and Objectives regardless of group
- ✅ Can create Work Plans in any group
- ✅ Can edit any Work Plan, Goal, or Objective
- ✅ Can delete any Work Plan, Goal, or Objective
- ✅ Can export any Work Plan
Editors (users without edit_others_workplans capability):
- ❌ Can only see Work Plans assigned to their specific groups
- ❌ Can only create Work Plans in their assigned groups
- ❌ Can only edit Work Plans, Goals, and Objectives in their groups
- ❌ Can only delete content in their groups
- ✅ Can export Work Plans they have access to
Capabilities Structure
The plugin uses these custom capabilities:
manage_workplans- Required to access the plugin interfaceedit_workplans- Required to create/edit work plansedit_others_workplans- Grants administrator-level access (see all content)delete_workplans- Required to delete goals and objectives
Default Role Assignments:
- Administrator: All capabilities (full access)
- Editor: Limited capabilities (group-restricted access)
Customization
Adding Custom CSS
Add custom styles to your theme's style.css or use a child theme:
/* Custom Work Plan Manager styles */
.wpm-container {
/* Your custom styles here */
}
Extending Functionality
The plugin provides several hooks and filters for customization:
// Example: Modify export data before generating file
add_filter('wpm_export_data', function($data, $workplan_id) {
// Modify $data as needed
return $data;
}, 10, 2);
// Example: Add custom validation
add_action('wpm_before_save_workplan', function($workplan_data) {
// Add custom validation logic
});
Custom Fields
To add additional fields:
- Create new ACF field groups
- Assign to appropriate post types
- Update the export functionality to include new fields
- Modify the JavaScript to handle new fields in the preview
Troubleshooting
Common Issues
-
Plugin Not Appearing in Menu
- Check user capabilities
- Ensure user has "manage_workplans" capability
-
ACF Fields Not Showing
- Verify ACF is installed and activated
- Ensure all required ACF fields exist and are properly configured
- Check that field names match exactly:
internal_status,related_work_plan_goals,goal_letter,work_plan_objectives, etc.
-
"Required post types not found" Error
- Ensure
workplan,workplan-goal, andworkplan-objectivepost types exist - These should be registered in your theme or another plugin
- Note: The plugin uses ACF relationship fields rather than WordPress post parent relationships
- Ensure
-
"Required taxonomies not found" Error
- Ensure
groupandgrant-yeartaxonomies exist - These should be registered in your theme or another plugin
- Ensure
-
Export Not Working
- Check file permissions on uploads directory
- Ensure server has sufficient memory and execution time
-
Permission Errors
- Verify PublishPress Permissions configuration (if using)
- Check group assignments and mappings
Pre-Installation Checklist
Before activating the plugin, ensure you have:
- [ ] Advanced Custom Fields installed and active
- [ ]
workplanpost type registered - [ ]
workplan-goalpost type registered - [ ]
workplan-objectivepost type registered - [ ]
grouptaxonomy registered - [ ]
grant-yeartaxonomy registered - [ ] All required ACF fields created and assigned to post types
Debug Mode
Enable WordPress debug mode to see detailed error messages:
// In wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
Check debug logs in /wp-content/debug.log
Support
For technical issues:
- Check the WordPress error logs
- Verify all requirements are met
- Test with default WordPress theme and minimal plugins
- Check browser console for JavaScript errors
File Structure
work-plan-manager/
├── work-plan-manager.php # Main plugin file
├── css/
│ └── work-plan-manager.css # Plugin styles
├── js/
│ └── work-plan-manager.js # Frontend JavaScript
├── includes/
│ ├── admin-page.php # Main admin interface
│ ├── export-handler.php # Export functionality
│ ├── utility-functions.php # Helper functions
│ ├── installation.php # Installation & setup
│ └── acf-behaviors.php # Optional ACF enhancements
└── README.md # This documentation
Optional ACF Enhancements
The acf-behaviors.php file is optional and provides these additional features:
Validation Features (when enabled):
- ✅ Unique Goal Letters - Prevents duplicate letters within the same Work Plan
- ✅ Unique Objective Numbers - Prevents duplicate numbers within the same Goal
- ✅ Real-time Validation - Shows error messages in ACF forms
Automation Features (when enabled):
- ✅ Auto-populate Taxonomy - Automatically copies group taxonomy from parent Work Plan to Goals and Objectives
- ✅ Suggested Values - Helper functions to suggest next available letters/numbers
- ✅ AJAX Suggestions - JavaScript can request suggested values for auto-completion
To Enable (optional):
- Edit
work-plan-manager.php - Find this line:
// require_once WPM_PLUGIN_PATH . 'includes/acf-behaviors.php'; - Uncomment it by removing the
// - Save the file
When You Don't Need It:
- Your ACF setup already handles validation
- You prefer to manage field behavior through your own code
- You want to keep the plugin as minimal as possible
Changelog
Version 1.1.0
Updates:
- ✅ Eliminated Grant Quarters: Removed all references to grant quarter sub-taxonomy. Only grant year taxonomy is now used.
- ✅ Field Structure Changes: Moved
timeline_descriptionfield from Work Plan Goals to Work Plan Objectives for better organization. - ✅ New Field Added: Added
measurable_outcomestextarea field to Work Plan Objectives for enhanced tracking. - ✅ Duplicate Validation: Added comprehensive validation to prevent duplicate goal letters, objective numbers, and output letters when reordering items.
Fixes:
- ✅ Fixed Metadata Display: Grant Year, Group, and Internal Status now properly appear in Work Plan form fields and tabular preview section.
- ✅ Form Field Population: Fixed issue where taxonomy and ACF field values weren't being loaded into forms when editing existing work plans.
- ✅ Preview Table Structure: Updated preview table headers and data structure to reflect new field organization.
Version 1.0.0
- Initial release
- Basic Work Plan, Goal, and Objective management
- ACF integration
- PublishPress Permissions integration
- Export functionality (Excel/CSV)
- Responsive design
- Real-time preview
License
This plugin is released under the GPL v2 or later license.
Credits
- Built with WordPress best practices
- Utilizes Advanced Custom Fields for enhanced functionality
- Integrates with PublishPress for advanced permissions
- Uses WordPress React components for preview functionality