Support

Account

Home Forums Bug Reports acf/prepare_field incomplete? Reply To: acf/prepare_field incomplete?

  • I’m looking at ACF Pro > includes > fields > class-acf-field-date_picker.php:

    
    // elements
    		$div = array(
    			'class'					=> 'acf-date-picker acf-input-wrap',
    			'data-date_format'		=> acf_convert_date_to_js($field['display_format']),
    			'data-first_day'		=> $field['first_day'],
    		);
    		$hidden_input = array(
    			'id'					=> $field['id'],
    			'name'					=> $field['name'],
    			'value'					=> $hidden_value,
    		);
    		$text_input = array(
    			'class' 				=> 'input',
    			'value'					=> $display_value,
    		);
    

    Why can we not change the 3rd last line there to:

    
    			'class' 				=> $field['class'] . ' input',
    

    ?

    And do this consistently for all other field types?

    For me, this is about applying Bootstrap 4 styles to the correct field elements for front-end forms. I can’t, because I can’t get to the input element to add a class, unless I make ACF (Pro) consistent in this way…

    Is this a missing bit of code, or deliberate??

    A