Home Forums General Issues User Type Redirect Issue


User Type Redirect Issue

  • I have user field type with issue initialiazing or setting the value after the page redirect.

    The field is work_id, where it save the current logged user id.

    I tried this method:

    method 1:
    $user = wp_get_current_user();
    update_field( ‘owner_id’, $user, $post_id );

    method 2:
    update_field(‘owner_id’, get_current_user_id(), $post_id);

    both this method is working, the value is saved to acf owner_id, owner_id is an acf user field type.

    The issue is on wp_safe_redirect or redirect. After the value saved to acf field, the page will redirect, where on target url, the acf user type defined as dropdown. But the selected value is not set on the dropdown, thus the current user is not selected.

    However, with same url (redirect), load the page, the acf field is working properly. Is anyone encounter this issue before?

    With Text field, no problem.

Viewing 1 post (of 1 total)

The topic ‘User Type Redirect Issue’ is closed to new replies.