'; if ( '' !== $placeholder ) { $select .= ''; } foreach ( $options as $option ) { $option_value = isset( $option['value'] ) ? (string) $option['value'] : ''; $option_label = isset( $option['label'] ) ? (string) $option['label'] : ''; // Mirror save.js: when a placeholder is present, skip any option that // duplicates the empty placeholder value. if ( '' !== $placeholder && '' === $option_value ) { continue; } // Honour the editor's "Default Value" control by pre-selecting the matching // option. The removed static save() never did this, so a select where an // author set a Default Value now reflects it on the frontend — an intentional // fix of a control that was previously a silent no-op. $selected = ( '' !== $default_val && $option_value === $default_val ) ? ' selected' : ''; $select .= ''; } $select .= ''; $inner = airowp_form_field_label_html( $field_id, $label, $required ); $inner .= $select; $inner .= airowp_form_field_help_html( $field_id, $help_text ); $wrapper = airowp_form_field_wrapper_attributes( $attributes, 'select', airowp_form_field_width_style( $field_width ) ); echo '