Files
Digital-Dabei-Hamburg-Job-M…/.planning/phases/05-mentor-job-board/05-03-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

104 lines
4.0 KiB
Markdown

---
phase: 05-mentor-job-board
plan: 03
type: execute
depends_on: []
files_modified: [includes/class-post-types.php]
---
<objective>
Automatically crop uploaded job logos to 200x200px square for consistent display across archive and detail pages.
Purpose: Ensure all job logos display at consistent size regardless of upload dimensions, preventing layout issues in Elementor templates.
Output: WordPress image size registration that auto-generates 200x200px cropped version on upload.
</objective>
<execution_context>
~/.claude/get-shit-done/workflows/execute-plan.md
./summary.md
</execution_context>
<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/01-foundation-setup/01-03-SUMMARY.md
# Source files:
@includes/class-post-types.php
@includes/class-acf-fields.php
**Tech stack available:** add_image_size() WordPress function, ACF image field with return_format='id'
**Established patterns:**
- ACF image field returns attachment ID (Phase 01-03: job_logo with return_format='id')
- Singleton pattern for post types class (Phase 01-02)
- Image sizes available via wp_get_attachment_image_src()
**Constraining decisions:**
- Phase 01-03: Logo field returns image ID, not URL, enabling access to all registered sizes
- Phase 01-03: Logo field optional (required=0) so not all jobs have logos
- PROJECT.md: Logo auto-crop to 200x200px for consistent display
- ROADMAP.md Phase 5: Logo upload and auto-crop to 200x200px
</context>
<tasks>
<task type="auto">
<name>Task 1: Register 200x200px cropped image size for job logos</name>
<files>includes/class-post-types.php</files>
<action>Add static method register_image_sizes() to DDHH_JM_Post_Types class. Inside method, call add_image_size('job-logo', 200, 200, true) - width 200, height 200, hard crop true (ensures square crop from center). Hook method to after_setup_theme action (priority 10) - this is standard WordPress timing for image size registration. Register hook in existing init() method or create new setup_hooks() method following singleton pattern if init() doesn't exist. This ensures WordPress automatically generates 200x200px version when logos uploaded via ACF field. Elementor templates can then request this size via wp_get_attachment_image() or wp_get_attachment_image_src() using size 'job-logo'.</action>
<verify>Check class-post-types.php contains register_image_sizes() method. Verify add_image_size called with parameters: 'job-logo', 200, 200, true. Confirm hook registered for after_setup_theme. Check method called from init() or setup_hooks().</verify>
<done>Image size 'job-logo' registered with 200x200px hard crop, hook properly registered for after_setup_theme, method integrated into class initialization</done>
</task>
</tasks>
<verification>
Before declaring plan complete:
- [ ] Image size 'job-logo' registered via add_image_size()
- [ ] Dimensions are 200x200px with hard crop enabled
- [ ] Hook registered for after_setup_theme action
- [ ] Method properly called from class initialization
</verification>
<success_criteria>
- WordPress image size 'job-logo' registered and available
- Uploaded logos auto-generate 200x200px cropped version
- Size accessible via standard WordPress image functions
- Elementor templates can use 'job-logo' size for consistent display
- Phase 5 complete - mentor job board fully functional
</success_criteria>
<output>
After completion, create `.planning/phases/05-mentor-job-board/05-03-SUMMARY.md`:
# Phase 5 Plan 3: Logo Auto-Crop Summary
**[Substantive one-liner - what shipped, not "phase complete"]**
## Accomplishments
- [Key outcome 1]
- [Key outcome 2]
## Files Created/Modified
- `includes/class-post-types.php` - Description
## Decisions Made
[Key decisions and rationale, or "None"]
## Issues Encountered
[Problems and resolutions, or "None"]
## Next Step
Phase 5 complete. Ready for Phase 6: Email Notifications (mentor opt-in and async processing).
</output>