HEX
Server: Apache/2.4.66 (Debian)
System: Linux 6dfabc3b2241 6.8.0-71-generic #71-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 22 16:52:38 UTC 2025 x86_64
User: (1000)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //proc/self/root/tmp/update-vff-content.php
<?php
/**
 * Update VFF page with inline ACF block data.
 * ACF blocks read from block comment JSON, not post meta.
 */

$page_id = 51;

// Build ACF block data array
$data = [];

// Helper: add field + its meta key reference
function add_field(&$data, $name, $key, $value) {
    $data[$name] = $value;
    $data["_$name"] = $key;
}

// -- Tabs (repeater) --
add_field($data, 'vff_tabs', 'field_donate_vff_tabs', 2);
add_field($data, 'vff_tabs_0_tab_label', 'field_donate_vff_tab_label', 'Donate');
add_field($data, 'vff_tabs_0_tab_active', 'field_donate_vff_tab_active', 1);
add_field($data, 'vff_tabs_1_tab_label', 'field_donate_vff_tab_label', 'The Different Ways to Give');
add_field($data, 'vff_tabs_1_tab_active', 'field_donate_vff_tab_active', 0);

// -- Subtabs (repeater) --
add_field($data, 'vff_subtabs', 'field_donate_vff_subtabs', 2);
add_field($data, 'vff_subtabs_0_subtab_label', 'field_donate_vff_subtab_label', 'General');
add_field($data, 'vff_subtabs_0_subtab_active', 'field_donate_vff_subtab_active', 0);
add_field($data, 'vff_subtabs_1_subtab_label', 'field_donate_vff_subtab_label', 'Vermont Farm Fund');
add_field($data, 'vff_subtabs_1_subtab_active', 'field_donate_vff_subtab_active', 1);

// -- Content with Image --
add_field($data, 'vff_content_image', 'field_donate_vff_content_image', 48);
add_field($data, 'vff_content_heading', 'field_donate_vff_content_heading', 'YOUR DONATION CAN SUPPORT MANY LOANS');
add_field($data, 'vff_content_description', 'field_donate_vff_content_description', 'Giving to the <strong>Vermont Farm Fund</strong> presents a unique opportunity to watch your donation support multiple Vermont farmers and food producers, one after another. Your contribution can be bundled with funds from other donors to make an initial loan to help sustain and grow the Vermont agricultural economy. As that loan is repaid, monies go back into the pool to be lent back out again and again.');

// -- Donation Section --
add_field($data, 'vff_donate_bg_image', 'field_donate_vff_donate_bg_image', 49);
add_field($data, 'vff_donate_heading', 'field_donate_vff_donate_heading', 'SUPPORT THE FUND');
add_field($data, 'vff_donate_tax_notice', 'field_donate_vff_donate_tax_notice', 'All donations are tax deductible to the fullest extent allowed by law. Our federal Tax ID Number is 57-1201683.');

// -- Donation Methods (repeater) --
add_field($data, 'vff_donate_methods', 'field_donate_vff_donate_methods', 3);

add_field($data, 'vff_donate_methods_0_method_title', 'field_donate_vff_method_title', 'Donate Online');
add_field($data, 'vff_donate_methods_0_method_description', 'field_donate_vff_method_description', 'Make a tax-free donation today.');

add_field($data, 'vff_donate_methods_1_method_title', 'field_donate_vff_method_title', 'Donate via Your Charitable Fund');
add_field($data, 'vff_donate_methods_1_method_description', 'field_donate_vff_method_description', 'You can also donate through your charitable fund via DAF Direct.');

add_field($data, 'vff_donate_methods_2_method_title', 'field_donate_vff_method_title', 'Mail a Check');
add_field($data, 'vff_donate_methods_2_method_description', 'field_donate_vff_method_description', "If you'd prefer to send a check, please address it to Vermont Farm Fund. Mail to: Vermont Farm Fund, c/o Center for an Agricultural Economy, PO Box 422, 140 Junction Road, Hardwick, VT 05843.");

// -- Testimonial --
add_field($data, 'vff_testimonial_image', 'field_donate_vff_testimonial_image', 50);
add_field($data, 'vff_testimonial_quote', 'field_donate_vff_testimonial_quote', 'Knowing that my donation dollars support farmers to improve their operation gives me the satisfaction that I am a part of their success. Enhancing access to local food is what it is all about!');
add_field($data, 'vff_testimonial_name', 'field_donate_vff_testimonial_name', 'Joe Goldstein');
add_field($data, 'vff_testimonial_title', 'field_donate_vff_testimonial_title', 'Donor');

// Build the block JSON
$block_json = json_encode([
    'name' => 'acf/donate-vff',
    'data' => $data,
    'mode' => 'preview',
], JSON_UNESCAPED_SLASHES);

// Full page content
$content = '<!-- wp:acf/hero {"name":"acf/hero","data":{"hero_heading":"VERMONT FARM FUND","_hero_heading":"field_hero_heading","hero_description":"Support Vermont farmers and food producers.","_hero_description":"field_hero_description"},"mode":"preview"} /-->' . "\n\n";
$content .= "<!-- wp:acf/donate-vff $block_json /-->" . "\n\n";
$content .= '<!-- wp:acf/cta {"name":"acf/cta","data":{"cta_heading":"GET INVOLVED","_cta_heading":"field_cta_heading","cta_description":"Learn more about ways you can support CAE.","_cta_description":"field_cta_description"},"mode":"preview"} /-->';

wp_update_post([
    'ID' => $page_id,
    'post_content' => $content,
]);

WP_CLI::success("Updated page $page_id with inline block data");
WP_CLI::log("Data keys: " . count($data));