image URL). * * Built once per request in get_field_preview_images() so every localized * copy is identical and the `suredonation_block_preview_images` filter runs * once. * * @var array|null * @since 1.5.0 */ private $preview_images = null; /** * Constructor. * * @since 0.0.1 */ public function __construct() { add_action( 'init', [ $this, 'register_embed_block_script' ], 5 ); add_action( 'init', [ $this, 'register_blocks' ] ); add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_editor_assets' ] ); add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_campaign_editor_assets' ] ); add_action( 'enqueue_block_editor_assets', [ $this, 'localize_embed_preview_images' ] ); add_filter( 'block_categories_all', [ $this, 'register_block_category' ], 10, 2 ); add_filter( 'block_editor_settings_all', [ $this, 'add_campaign_iframe_styles' ], 10, 2 ); add_filter( 'block_editor_settings_all', [ $this, 'add_donation_form_iframe_styles' ], 10, 2 ); add_filter( 'block_editor_settings_all', [ $this, 'add_phone_iframe_styles' ], 10, 2 ); add_action( 'enqueue_block_assets', [ $this, 'enqueue_preview_field_scripts' ] ); } /** * Load the dropdown and phone field libraries into the block editor canvas. * * The donation form embed block previews the real form through the block's PHP * render_callback (ServerSideRender), which returns markup only — a REST render * emits no wp_footer(), so nothing the render callback enqueues ever reaches the * page. Without their libraries the dropdown stays an unstyled native