Task Templates

What Are Task Templates?

Task Templates are predefined task structures that allow administrators to quickly create multiple tasks with consistent formatting, fields, and subtask hierarchies. Instead of manually creating the same types of tasks repeatedly, you can build a template once and apply it instantly to any compatible post or page.

Templates capture task titles, descriptions, priority levels, categories, tags, custom fields, and complete subtask structures. This feature is currently available only to administrators (users with manage_options capability) and is designed for organizations that need standardized task workflows.

Why Use Task Templates?

Task Templates solve three critical problems for content teams and project managers:

  • Eliminate repetitive task creation: Create complex task structures with multiple subtasks in seconds instead of minutes
  • Ensure consistency: Every instance of a template follows the same structure, priorities, and categorization
  • Speed up project setup: Deploy entire task workflows instantly when starting similar projects or content pieces

For example, a content marketing team can create a “Blog Post Production” template that includes tasks for research, writing, editing, SEO optimization, and publishing, each with appropriate priorities and assignees. Applying this template to a new blog post creates all necessary tasks immediately.

How to Create Task Templates

Templates are managed through the WordPress admin area under Orbital > Templates. Only administrators can create and manage templates.

Creating Your First Template

Navigate to Orbital > Templates and click Add New Template. You’ll see the Template Builder interface with two main sections:

Template Builder Section: This is where you design your task structure. Click “Add Task” to create your first template task. Each task can include:

  • Task title and description
  • Priority level (if custom priority fields are configured)
  • Subtasks with their own titles and descriptions
  • Category and tag assignments (applied when template is used)

Template Settings Section: Configure template metadata:

  • Description: Explain what this template is for and when to use it
  • Allowed Post Types: Control which post types can use this template (pages, posts, custom post types)

Screenshot: [Template Builder interface showing the main editor with task fields and the settings sidebar]

Building Complex Task Structures

The Template Builder supports nested task hierarchies. After creating a main task, click “Add Subtask” to create child tasks. Each subtask becomes a separate WordPress post linked to its parent task.

Tasks can be reordered by dragging the handle icon, and collapsed/expanded using the arrow button for easier management of complex templates.

Template Settings and Restrictions

Use the Allowed Post Types setting to control template availability. For example, a “Product Launch” template might only be available for product post types, while a “Content Review” template might apply to all post types.

Leave post types unchecked to make templates available everywhere, or select specific types for focused use cases.

How to Apply Templates

Templates are applied directly from post and page editing screens through the Tasks metabox.

Applying from Post Edit Screen

When editing any post or page, look for the Tasks metabox in the sidebar. If templates are available for the current post type, you’ll see an “Apply Template” button next to “Add Task”.

Screenshot: [Tasks metabox showing both “Add Task” and “Apply Template” buttons]

Click “Apply Template” to open the template selection modal. You’ll see:

  • Template name and description
  • Task count and subtask count
  • Preview of what will be created

Select your desired template and click “Apply Template”. The system will create all tasks immediately and display them in the Tasks metabox.

Template Application Process

When you apply a template, the system:

  1. Validates permissions: Ensures you can edit the current post
  2. Creates parent tasks: Each main template task becomes a new WordPress post
  3. Creates subtasks: Subtasks are created as child posts linked to their parent
  4. Applies metadata: Categories, tags, priorities, and custom fields are set
  5. Sets post status: Tasks use appropriate status based on your permissions
  6. Tracks usage: Template usage count is incremented for reporting

All created tasks are immediately visible in the Tasks metabox and can be edited like any other task.

What Data Is Preserved in Templates

Templates capture comprehensive task information but exclude certain runtime-specific data:

Included in Templates

  • Task titles and descriptions (supports rich text formatting)
  • Priority levels from custom fields
  • Category and tag assignments
  • Subtask structures and relationships
  • Custom field default values

Excluded from Templates

  • Specific assignee information (must be set after applying template)
  • Due dates (unless using relative date custom fields)
  • Task status (determined by permissions when applied)
  • Comment and revision history
  • File attachments or media

This design ensures templates remain reusable across different contexts while preserving the core task structure and requirements.

Template Use Cases and Best Practices

Content Production Workflows

Create templates for recurring content types:

Blog Post Template: Research task, draft writing, peer review, SEO optimization, publishing, and promotion tasks with appropriate priorities and categories.

Product Launch Template: Market research, feature specification, development tasks, testing phases, documentation, and launch coordination with cross-team dependencies.

Project Management Templates

Website Redesign Template: Discovery phase, wireframing, design approval, development sprints, testing, and deployment tasks with realistic timeline relationships.

Client Onboarding Template: Initial consultation, requirements gathering, project setup, kickoff meeting, and milestone planning tasks.

Best Practices for Template Design

Keep templates focused: Create specific templates for distinct workflows rather than trying to build one massive template for everything.

Use descriptive task titles: Template tasks should clearly indicate what needs to be done, since they’ll be used across different projects.

Leverage categories and tags: Consistent categorization makes it easier to filter and manage tasks created from templates.

Plan for customization: Templates provide the foundation, but individual tasks may need adjustment after creation.

Template Maintenance

Regular template review ensures continued effectiveness:

  • Monitor template usage counts to identify popular vs. unused templates
  • Update templates when workflows change or improve
  • Archive obsolete templates to reduce selection complexity
  • Create new templates when you notice repeated manual task creation patterns

Templates are most effective when they reflect actual, tested workflows rather than theoretical ideal processes. Start with templates for your most common task patterns and expand based on real usage.

Developer Integration

Retrieving Available Templates

Developers can programmatically access templates using the TaskTemplatePostType::get_templates_for_post_type() method:

$templates = \Orbital\PostTypes\TaskTemplatePostType::get_templates_for_post_type( 'post' );
foreach ( $templates as $template ) {
    $template_data = get_post_meta( $template->ID, '_orb_template_data', true );
    $task_count = count( $template_data['tasks'] ?? array() );
}

Custom Template Application

Templates can be applied programmatically through the AJAX handler or by replicating the template application logic:

$handler = new \Orbital\Ajax\ApplyTaskTemplateHandler();
// Note: Direct method calls require proper nonce validation and permission checks

Extending Template Data Structure

Template data is stored as JSON in the _orb_template_data meta field with this structure:

$template_data = array(
    'tasks' => array(
        array(
            'title' => 'Task Title',
            'content' => 'Task Description',
            'priority' => 'high',
            'categories' => array( 1, 2 ),
            'tags' => array( 5, 6 ),
            'custom_fields' => array(),
            'subtasks' => array(
                array(
                    'title' => 'Subtask Title',
                    'content' => 'Subtask Description'
                )
            )
        )
    )
);

This structure can be extended through custom fields and taxonomy integrations while maintaining backward compatibility.