$attributes Block attributes. * @since 0.0.2 */ public function __construct( $attributes ) { $this->set_properties( $attributes ); $this->set_input_label( __( 'Dropdown', 'sureforms' ) ); $this->set_error_msg( $attributes, 'srfm_dropdown_block_required_text' ); $this->slug = 'dropdown'; $this->multi_select_attr = ! empty( $attributes['multiSelect'] ) ? 'true' : 'false'; $this->search_attr = ! empty( $attributes['searchable'] ) ? 'true' : 'false'; $this->set_markup_properties(); $this->set_aria_described_by(); $this->set_label_as_placeholder( $this->input_label ); $this->placeholder = ! empty( $this->placeholder_attr ) ? $this->label : __( 'Select an option', 'sureforms' ); } /** * Data attribute markup for min and max value * * @since 0.0.13 * @return string */ protected function data_attribute_markup() { $data_attr = ''; if ( 'false' === $this->multi_select_attr ) { return ''; } if ( $this->min_selection ) { $data_attr .= 'data-min-selection="' . esc_attr( $this->min_selection ) . '"'; } if ( $this->max_selection ) { $data_attr .= 'data-max-selection="' . esc_attr( $this->max_selection ) . '"'; } return $data_attr; } /** * Render the sureforms dropdown classic styling * * @since 0.0.2 * @return string|boolean */ public function markup() { ob_start(); ?>
data_attribute_markup() ); ?> name="srfm-slug ); ?>-block_id ); ?>field_name ); ?>" type="hidden" value=""/> label_markup ); ?> help_markup ); ?>
options ) ) { ?>
error_msg_markup ); ?>