Support

Account

Home Forums Front-end Issues External condition for displaying field Reply To: External condition for displaying field

  • I was about to post that you could set the class of wrapper to hidden and then add some custom CSS when I stumbled upon something that I was unaware of.

    Using and acf/load_field filter http://www.advancedcustomfields.com/resources/acfload_field/

    
    add_filter('acf/load_field/name=test_hidden_field', 'load_field_test_hidden_field');
    function load_field_test_hidden_field($field) {
    	$condition = false; 
    	if (!$condition) {
    		$field['wrapper']['class'] = 'hidden';
    	}
    	return $field;
    }