/** * Mounts the redesigned Background Image control into core's own `background_image` section — * see `override_background_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 BackgroundImageSection from '../sections/background-image'; // Must match the ids `Customizer::override_background_image()` registers the // Mount_Control with. const MOUNT_ID = 'aureon-background_image-root'; const CONTROL_ID = 'aureon_background_image_mount'; export default function mountBackgroundImage(): void { onReady( () => { onControlEmbedded( CONTROL_ID, () => { const node = document.getElementById( MOUNT_ID ); if ( ! node ) { return; } createRoot( node ).render( ); } ); } ); }