Support

Account

Home Forums Front-end Issues Front-end form doesnt populate 'value' field anymore Reply To: Front-end form doesnt populate 'value' field anymore

  • Still not sure why the values aren’t loading but I solved the issue.

    I was also, in conjunction with the code snippet above using the following ‘prepare_field’ hooks:

    function my_acf_prepare( $field ) {
        
    /* this was added to fix above */
        $field['value'] = htmlspecialchars($_GET["xxx"]);
    
    /* this was always here */
        $field['readonly'] = true;
    
        return $field;
        
    }
    
    add_filter('acf/prepare_field/name=zzz', 'my_acf_prepare');

    I just added a ‘value’ $field object into the prepare field code above that just assigns a value to the field during the prepare_field action instead of using ‘load_value’ from above in cojunction with the ‘prepare_field’ hook.

    Hope this helps someone else.