/** * Mounts the redesigned Header Image control into core's own `header_image` section — * see `override_header_image()` in `Aureon\Customizer\Customizer`. * * Same pattern as `site-identity.tsx`: a one-off root inside a *core* section, * backed directly by core `wp.customize` settings. */ import { createRoot } from '@wordpress/element'; import { onControlEmbedded, onReady } from '../customize-bridge'; import HeaderImageSection from '../sections/header-image'; // Must match the ids `Customizer::override_header_image()` registers the // Mount_Control with. const MOUNT_ID = 'aureon-header_image-root'; const CONTROL_ID = 'aureon_header_image_mount'; export default function mountHeaderImage(): void { onReady( () => { onControlEmbedded( CONTROL_ID, () => { const node = document.getElementById( MOUNT_ID ); if ( ! node ) { return; } createRoot( node ).render( ); } ); } ); }