diff --git a/templates/listing-form/custom-fields/select.php b/templates/listing-form/custom-fields/select.php index ac8d2b9fc1..8df27290ff 100644 --- a/templates/listing-form/custom-fields/select.php +++ b/templates/listing-form/custom-fields/select.php @@ -2,24 +2,34 @@ /** * @author wpWax * @since 6.6 - * @version 8.6 + * @version 8.9.4 */ if ( ! defined( 'ABSPATH' ) ) exit; // Get conditional logic attributes using centralized method $conditional_logic_attr = $listing_form->get_conditional_logic_attributes( $data ); +$options = ! empty( $data['options'] ) && is_array( $data['options'] ) ? $data['options'] : []; +$has_empty_option = in_array( '', wp_list_pluck( $options, 'option_value' ), true ); +$show_empty_option = empty( $data['required'] ) && ! $has_empty_option; +$placeholder = ! empty( $data['placeholder'] ) ? $data['placeholder'] : __( 'Select...', 'directorist' ); ?>
> field_label_template( $data );?> - +