Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter Kindler

    (@pedrotrindade)

    Meanwhile I figured it out.
    For any Caldera users out there wondering how to achieve this, the answer is query vars.
    On your form page, or page template(s), create a user object for the current user like this:
    $user = get_user_by(‘id’, get_current_user_id());

    Get the field (if you’re using ACF)
    $yourField = get_field(‘yourFieldID’, $user);

    Create the query var:
    set_query_var(‘yourQueryVarName’, $yourField);

    Lastly, assign your query var to the caldera field default value:
    {query_var:yourQueryVarName}

    And thats it, now your logged in have prefilled form fields.
    Happy Coding.

Viewing 1 replies (of 1 total)