prepare_attributes( jet_form_builder()->blocks->get_form_class()->get_attributes() ); } protected function prepare_attributes( $attrs ): array { $result = array(); $arguments = new Form_Arguments(); foreach ( $attrs as $name => $attr ) { if ( ! array_key_exists( $name, $arguments->props ) ) { continue; } $result[ $name ] = $attr['default']; } return $result; } /** * @param $settings * * @return mixed */ public function generate( $settings ) { /** @var Form $form */ $form = jet_form_builder()->blocks->get_form_class(); return do_shortcode( $form->render_callback_field( $settings ) ); } }