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: //tmp/fix-support-cae-hero2.php
<?php
/**
 * Fix Support CAE page hero — replace MVV placeholder with correct Figma content.
 */

$page_id = 25;
$post = get_post($page_id);
$content = $post->post_content;

// Find the hero block — it ends with /-->
$start = strpos($content, '<!-- wp:acf/hero');
if ($start === false) {
    WP_CLI::error("No hero block found");
}
$end = strpos($content, '/-->', $start);
if ($end === false) {
    WP_CLI::error("Could not find end of hero block");
}
$end += 4; // include the /-->

$new_hero = '<!-- wp:acf/hero {"name":"acf/hero","data":{"hero_heading":"SUPPORT CAE","_hero_heading":"field_hero_heading","hero_description":"The future we imagine can only exist if we build it together. As a community-based nonprofit, we rely on your voice and your donation to keep our programs running year after year.","_hero_description":"field_hero_description"},"mode":"preview"} /-->';

$new_content = substr($content, 0, $start) . $new_hero . substr($content, $end);

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

WP_CLI::success("Updated hero: SUPPORT CAE (from Figma 19268:619467)");