Skip to content

Add ACF investment report field for pension fund pages#69

Open
taavipertman-glitch wants to merge 2 commits into
masterfrom
acf-investment-report-fields
Open

Add ACF investment report field for pension fund pages#69
taavipertman-glitch wants to merge 2 commits into
masterfrom
acf-investment-report-fields

Conversation

@taavipertman-glitch
Copy link
Copy Markdown
Contributor

Summary

  • Add investment_report_file ACF field to TUK75, TUK00, TUV100 fund pages (matching TKF100's existing pattern)
  • Templates use ACF field when set, fall back to current hardcoded URL when not set

Safe to deploy immediately — no behavior change until someone sets the ACF field on a fund page.

What this enables

Changes

  • helpers/acf/fund-pension.php — new ACF field group with investment_report_file for page templates page_fund-stocks.php, page_fund-bonds.php, page_fund-third.php
  • helpers/acf/init.php — include the new file
  • fund-stocks-details.php — use get_field('investment_report_file') with hardcoded fallback
  • fund-bonds-details.php — same
  • fund-third-details.php — same

After merging

Once the ACF fields are set on each fund page (either manually or via REST API), the hardcoded fallback URLs can be removed in a follow-up cleanup.

🤖 Generated with Claude Code

taavipertman-glitch and others added 2 commits May 28, 2026 15:06
Add investment_report_file ACF field to the stocks, bonds, and third
pillar fund page templates, matching the pattern TKF100 already uses.

When the ACF field is set (via wp-admin or REST API), it overrides the
hardcoded report URL. When not set, the current hardcoded URL remains
as fallback — safe to deploy without setting the fields first.

This enables:
- Manual report updates from wp-admin (same as TKF100 today)
- Automated updates via WordPress REST API from onboarding-service

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add esc_url() and esc_html() to prevent potential XSS via
ACF-managed URLs. Guard preg_match before accessing $matches
to avoid PHP notices when URL has no /YYYY/MM/ date segment.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant