---
phase: 02-provider-registration-auth
plan: 03
type: execute
depends_on: []
files_modified: [includes/class-dashboard.php, templates/provider-dashboard.php]
---
Create provider dashboard template that lists user's own job_offer posts.
Purpose: Give providers a central view of their published job listings.
Output: Dashboard page accessible at /anbieter-dashboard/ showing provider's jobs with edit/view links.
~/.claude/get-shit-done/workflows/execute-plan.md
./summary.md
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/phases/01-foundation-setup/01-02-SUMMARY.md
@.planning/phases/01-foundation-setup/01-03-SUMMARY.md
**From Phase 1:**
- Custom post type `job_offer` exists with custom capabilities
- Providers have edit_job_offers capability (own posts only)
- ACF fields available: job_location, job_type, job_deadline, job_contact_email, job_logo
**Requirements:**
- German UI
- List only current user's job_offer posts
- Show edit and view links
- Simple table layout
Task 1: Create dashboard template
templates/provider-dashboard.php, includes/class-dashboard.php
Create `templates/provider-dashboard.php`:
- Check if user is logged in and has ddhh_provider role (else show error message)
- Query current user's job_offer posts using WP_Query:
- post_type: 'job_offer'
- author: get_current_user_id()
- post_status: ['publish', 'pending', 'draft']
- orderby: 'date'
- order: 'DESC'
- Display results in HTML table with columns:
1. Title (job post title)
2. Status (Veröffentlicht / Ausstehend / Entwurf)
3. Location (ACF field job_location)
4. Type (ACF field job_type)
5. Actions (Bearbeiten link to edit screen, Ansehen link to public view if published)
- German labels for all headings
- If no jobs, show message "Sie haben noch keine Stellenangebote erstellt."
Create `includes/class-dashboard.php` with static method get_template():
- Returns path to templates/provider-dashboard.php
- Handles template loading with load_template()
DO NOT use wp-admin edit links - providers should not access WP-Admin. Use frontend edit approach or direct edit_post_link() which WordPress handles based on capabilities.
Template file exists, displays current user's jobs in table format, German labels present
Dashboard template created, queries user's posts correctly, displays in table with German labels
Task 2: Create dashboard page and shortcode
includes/class-dashboard.php, includes/class-pages.php
In class-pages.php create_provider_pages(), add second page creation:
- post_title: 'Anbieter Dashboard'
- post_name: 'anbieter-dashboard'
- post_content: [ddhh_provider_dashboard] shortcode
- Store page ID in option 'ddhh_jm_dashboard_page_id'
In class-dashboard.php, register shortcode 'ddhh_provider_dashboard':
- Shortcode handler loads templates/provider-dashboard.php
- Returns output buffered content
Check page doesn't already exist before creating.
Hook shortcode registration to 'init' action in main class.
Dashboard page exists at /anbieter-dashboard/, shortcode renders template, table displays user's jobs
Dashboard page created, shortcode functional, displays job list for logged-in provider
Before declaring plan complete:
- [ ] Dashboard template queries only current user's job_offer posts
- [ ] Table displays with German column headings
- [ ] Edit and View links present for each job
- [ ] Status displayed in German (Veröffentlicht/Ausstehend/Entwurf)
- [ ] Empty state message shows when no jobs exist
- [ ] Page accessible at /anbieter-dashboard/
- All tasks completed
- Dashboard functional for providers
- Queries scoped to current user
- German UI throughout
- Ready for 02-04 (access control)