controls['form-list'] = [ 'label' => esc_html__('Form list', 'bit-form'), 'type' => 'select', 'options' => $options, 'inline' => true, 'clearable' => false, ]; } public function enqueue_scripts() { // for custom script } private function getStyle($formId) { $style = ''; if (file_exists(BITFORMS_CONTENT_DIR . DIRECTORY_SEPARATOR . 'form-styles')) { $cssFile = BITFORMS_CONTENT_DIR . DIRECTORY_SEPARATOR . 'form-styles' . DIRECTORY_SEPARATOR . "bitform-{$formId}-formid" . '.css'; if (file_exists($cssFile)) { $style = file_get_contents($cssFile); } else { $style = ''; } } return ""; } public function render() { echo "
render_attributes('_root')}>"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped if (empty($this->settings['form-list'])) { echo $this->render_element_placeholder([ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- The output of this method is controlled by the plugin and is not user input, safe to output as-is. 'icon-class' => esc_attr($this->icon), 'title' => esc_html__('No form selected', 'bit-form'), 'description' => esc_html__('Please select a form from the Form List available in the Bit Form element settings.', 'bit-form'), // Legacy attribute 'text' => esc_html__('No form selected', 'bit-form') ]); } if (!empty($this->settings['form-list'])) { echo $this->getStyle($this->settings['form-list']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- CSS from admin-controlled file; form ID from Bricks element settings echo do_shortcode('[bitform id="' . esc_attr($this->settings['form-list']) . '"]'); } echo '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } }