elin-r
3/29/2017 - 11:04 PM

Preload URL parameters to ACF field

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

add_filter('acf/load_value/name=your_field_name', function( $value, $post_id, $field ) {

if ( $_GET['price'] ) {
$value = sanitize_text_field( $_GET['price'] );
}

return $value;

}, 10, 3);