From 44df5596e61ffdace63fb54926e07d8fffd5e89c Mon Sep 17 00:00:00 2001 From: Taavi Pertman Date: Thu, 28 May 2026 15:06:17 +0300 Subject: [PATCH 1/3] Add ACF investment report field for TUK75, TUK00, TUV100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../tuleva/helpers/acf/fund-pension.php | 51 +++++++++++++++++++ .../themes/tuleva/helpers/acf/init.php | 1 + .../components/fund-bonds-details.php | 5 +- .../components/fund-stocks-details.php | 5 +- .../components/fund-third-details.php | 5 +- 5 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 src/wp-content/themes/tuleva/helpers/acf/fund-pension.php diff --git a/src/wp-content/themes/tuleva/helpers/acf/fund-pension.php b/src/wp-content/themes/tuleva/helpers/acf/fund-pension.php new file mode 100644 index 00000000..01093aef --- /dev/null +++ b/src/wp-content/themes/tuleva/helpers/acf/fund-pension.php @@ -0,0 +1,51 @@ + 'group_fund_pension_investment_report', + 'title' => 'Investment Report', + 'fields' => array ( + array ( + 'key' => 'field_fund_pension_investment_report', + 'label' => 'Investment Report', + 'name' => 'investment_report_file', + 'type' => 'file', + 'instructions' => 'Select the latest investment report PDF from media library. When set, this replaces the hardcoded report URL in the template.', + 'required' => 0, + 'return_format' => 'url', + 'library' => 'all', + 'mime_types' => 'pdf', + ), + ), + 'location' => array ( + array ( + array ( + 'param' => 'page_template', + 'operator' => '==', + 'value' => 'page_fund-stocks.php', + ), + ), + array ( + array ( + 'param' => 'page_template', + 'operator' => '==', + 'value' => 'page_fund-bonds.php', + ), + ), + array ( + array ( + 'param' => 'page_template', + 'operator' => '==', + 'value' => 'page_fund-third.php', + ), + ), + ), + 'menu_order' => 10, + 'position' => 'normal', + 'style' => 'default', + 'label_placement' => 'top', + 'instruction_placement' => 'label', + 'active' => 1, +)); + +endif; diff --git a/src/wp-content/themes/tuleva/helpers/acf/init.php b/src/wp-content/themes/tuleva/helpers/acf/init.php index 01fe256c..034ab40c 100644 --- a/src/wp-content/themes/tuleva/helpers/acf/init.php +++ b/src/wp-content/themes/tuleva/helpers/acf/init.php @@ -10,6 +10,7 @@ 'helpers/acf/membership.php', // Membership page 'helpers/acf/fund-other.php', // Other fund pages 'helpers/acf/fund-savings.php', // Savings fund page + 'helpers/acf/fund-pension.php', // Pension fund investment report field (TUK75, TUK00, TUV100) 'helpers/acf/fund-choosing.php', // Instructions — Step 1 page fields 'helpers/acf/jobs.php' // Jobs page fields ]; diff --git a/src/wp-content/themes/tuleva/templates/components/fund-bonds-details.php b/src/wp-content/themes/tuleva/templates/components/fund-bonds-details.php index 5f655940..15979a07 100644 --- a/src/wp-content/themes/tuleva/templates/components/fund-bonds-details.php +++ b/src/wp-content/themes/tuleva/templates/components/fund-bonds-details.php @@ -80,7 +80,10 @@