elin-r
8/7/2017 - 11:24 AM

Give ACF field unique ID and disable it

// Pre load URL parameter into certain field...

function jwplayervideoid( $value, $post_id, $field )
{
        $value = sanitize_text_field( video . uniqid() );
        
    return $value;
}

add_filter('acf/load_value/name=filmer-videoid', 'jwplayervideoid', 10, 3);

function my_acf_admin_head() {
echo '
	<script type="text/javascript">
jQuery(function( $ ){

	$(document).ready(function() {
		$( "#acf-field-filmer-videoid" ).prop( "disabled", true );
	});
});
	</script>';
}

add_action('acf/input/admin_head', 'my_acf_admin_head');