(int) $f->id, 'title' => $f->title ); }, $forms ); // Embedded + Popup Modal are the two display styles available in // Lite. Pro adds Floating Button to this same list via the filter // below (mirrors the 'acquis_form_display_styles' allow-list used // server-side). $display_styles = apply_filters( 'acquis_form_block_display_style_options', array( array( 'label' => __( 'Use form default', 'acquisitionsuite' ), 'value' => '' ), array( 'label' => __( 'Embedded', 'acquisitionsuite' ), 'value' => 'embedded' ), array( 'label' => __( 'Popup Modal', 'acquisitionsuite' ), 'value' => 'popup' ), ) ); wp_localize_script( 'acquis-form-block-editor', 'ACQUIS_FormBlockData', array( 'forms' => $form_list, 'displayStyles' => $display_styles, ) ); register_block_type( ACQUIS_PLUGIN_DIR . 'blocks/form', array( 'editor_script' => 'acquis-form-block-editor', 'render_callback' => array( __CLASS__, 'render' ), ) ); } /** * @param array $attributes Block attributes (formId, display). * @return string HTML */ public static function render( $attributes ) { if ( ! class_exists( 'ACQUIS_Form_Shortcode' ) ) { return ''; } return ACQUIS_Form_Shortcode::render_standalone_form( array( 'id' => absint( $attributes['formId'] ?? 0 ), 'display' => sanitize_key( $attributes['display'] ?? '' ), ) ); } }