Files
Digital-Dabei-Hamburg-Job-M…/.planning/phases/05-mentor-job-board/05-01-PLAN.md
Viktor Miller ac60de5d99 docs(05): create phase plan
Phase 05: Mentor Job Board
- 3 plans created (parallel-ready)
- 5 total tasks defined
- Ready for execution

Plans:
- 05-01: Archive access control and query setup
- 05-02: Job application form with provider notification
- 05-03: Logo auto-crop to 200x200px

All plans independent (depends_on: []), can execute in parallel.
2026-01-14 20:22:35 +09:00

5.1 KiB

phase, plan, type, depends_on, files_modified
phase plan type depends_on files_modified
05-mentor-job-board 01 execute
includes/class-access-control.php
includes/class-archive.php
Protect job archive from public access and configure published jobs query for Elementor template.

Purpose: Ensure only logged-in users (mentors/subscribers) can browse jobs, while providing query setup that Elementor templates will use. Output: Protected archive with access control, query configuration helper for Elementor.

<execution_context> ~/.claude/get-shit-done/workflows/execute-plan.md ./summary.md </execution_context>

@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md

Prior work this plan builds on:

@.planning/phases/01-foundation-setup/01-02-SUMMARY.md @.planning/phases/02-provider-registration-auth/02-04-SUMMARY.md

Source files:

@includes/class-access-control.php @includes/class-post-types.php

Tech stack available: template_redirect hook, WP_Query filters, is_user_logged_in() Established patterns:

  • Access control via template_redirect hook (Phase 02-04)
  • Custom post type with archive slug 'jobangebote' (Phase 01-02)
  • Role-based redirects to login page (Phase 02-04)

Constraining decisions:

  • Phase 01-02: Archive slug is 'jobangebote', supports has_archive
  • Phase 02-04: Access control uses template_redirect, redirects to /anbieter-login/
  • PROJECT.md: Protected job archive (logged-in mentors only), Elementor Pro theme integration
Task 1: Add archive access control to existing access control class includes/class-access-control.php Add method protect_job_archive() that hooks template_redirect (priority 10). Check if current page is job_offer archive (is_post_type_archive('job_offer')). If yes and user NOT logged in, redirect to /anbieter-login/ with wp_safe_redirect. Register hook in existing setup_hooks() method following established pattern from protect_provider_dashboard(). This ensures mentors (subscribers) can browse jobs but public cannot access archive. Check class-access-control.php contains protect_job_archive() method. Verify hook registered in setup_hooks(). Confirm redirect logic uses is_post_type_archive() and is_user_logged_in(). Archive protection method exists, hook registered, redirect logic matches provider dashboard pattern Task 2: Create archive query helper class for Elementor integration includes/class-archive.php, includes/class-ddhh-job-manager.php, ddhh-job-manager.php Create new includes/class-archive.php with class DDHH_JM_Archive. Add static method setup_hooks() that registers pre_get_posts filter (priority 10). In filter callback modify_archive_query($query), check if is job_offer archive AND is main query: set post_status='publish', orderby='date', order='DESC', posts_per_page=-1 (show all published jobs). This ensures Elementor Loop Grid displays only published jobs sorted by newest first. Initialize class in class-ddhh-job-manager.php following existing pattern (DDHH_JM_Notifications::setup_hooks()). Add file_exists check and require_once in main plugin file ddhh-job-manager.php following established pattern. Check includes/class-archive.php exists with DDHH_JM_Archive class. Verify pre_get_posts filter registered. Confirm query modification only affects job_offer archives. Verify class initialized in main class and required in main plugin file. Archive query class created, filter modifies only job archives to show published posts sorted by date, class properly initialized and required Before declaring plan complete: - [ ] Archive access control method exists in class-access-control.php - [ ] Archive query helper class exists in includes/class-archive.php - [ ] Both hooks registered (template_redirect and pre_get_posts) - [ ] Redirect targets /anbieter-login/ for consistency - [ ] Query modification only affects job_offer post type archives - [ ] Classes properly initialized following established patterns

<success_criteria>

  • Archive protected from public access (redirect to login)
  • Logged-in users can access /jobangebote/ archive
  • Query helper ensures only published jobs shown in archive
  • Jobs sorted by date (newest first)
  • Elementor Loop Grid can use default archive query </success_criteria>
After completion, create `.planning/phases/05-mentor-job-board/05-01-SUMMARY.md`:

Phase 5 Plan 1: Archive Access Control Summary

[Substantive one-liner - what shipped, not "phase complete"]

Accomplishments

  • [Key outcome 1]
  • [Key outcome 2]

Files Created/Modified

  • includes/class-access-control.php - Description
  • includes/class-archive.php - Description
  • includes/class-ddhh-job-manager.php - Description
  • ddhh-job-manager.php - Description

Decisions Made

[Key decisions and rationale, or "None"]

Issues Encountered

[Problems and resolutions, or "None"]

Next Step

Ready for parallel execution with 05-02 and 05-03 (independent plans).