Support

Account

Home Forums General Issues How to save image URL as a Text field? Reply To: How to save image URL as a Text field?

  • Something like this will work for you. You will want to expand on this function to make sure the $imagearray and several other security checks.

    function my_acf_save_post( $post_id ) {
        $user_id = get_current_user_id();
        $imagearray = get_field('user_image','user_' . $user_id);
        $imagepath = $imagearray['url'];
        update_field('image_url', $imagepath);
    }
    add_action('acf/save_post', 'my_acf_save_post', 20);