Support

Account

Home Forums Feature Requests Field label – Show/hide option Reply To: Field label – Show/hide option

  • I know it’s been a year but, in case this can help someone, this seems to do it, at least for me:

    
    add_action('acf/render_field_settings', 'hidelabel_render_field_settings');
    function hidelabel_render_field_settings( $field ) {	
    	acf_render_field_setting( $field, array(
    		'label'			=> __('Hide Label?'),
    		'instructions'	=> '',
    		'name'			=> 'hide_label',
    		'type'			=> 'true_false',
    		'ui'			=> 1,
    	), true);	
    }
    
    add_filter('acf/prepare_field', 'hidelabel_prepare_field');
    function hidelabel_prepare_field( $field )
    {
    	if ($field['hide_label'])
    		echo '
    		<style type="text/css">
    			.acf-field-', substr($field['key'],6),' > .acf-label {display: none;}
    		</style>';
    	return $field;
    }