Support

Account

Home Forums Front-end Issues Overwrite core function acf_render_field_wrap Reply To: Overwrite core function acf_render_field_wrap

  • Tnx. I was a little afraid it would be done with javascript.

    I tried to figure out how (many times) with this tutorial:
    https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields

    I know how to call javascript to a field but I don’t know what code I should use to add it…

    Would it be something like this?

    
    // Customization to datepicker and timepicker
    function yl_add_label_class_to_acf_fields() {
    
    	?>
    	<script type="text/javascript">
    	(function($) {
    
    		// Check ACF
    		if(typeof acf === 'undefined')
    			return;
    		// Date picker & Google Maps compatibility
    		$('.acf-label').addClass('uk-form-label');
    
    	})(jQuery);	
    	</script>
    
    	<?php
    
    }
    
    add_action('acf/input/admin_footer', 'yl_add_label_class_to_acf_fields');