Support

Account

Home Forums Front-end Issues Add Custom User Meta to ACF Form Fields Reply To: Add Custom User Meta to ACF Form Fields

  • I found a solution to my problem. I ended up using the wpmu_new_blog action hook to update the post meta when a new blog is created.

    Here is a basic idea of the code used:

    add_action('wpmu_new_blog', 'katart_update_new_blog', 10, 2);
    function katart_update_new_blog($blog_id,$user_id) {
       switch_to_blog($blog_id);
    
       $admin = get_userdata( $user_id );
    
       update_post_meta( 4, 'custom_post_meta', $admin->custom_user_meta );
    
       restore_current_blog();
    }

    This was a unique situation where I know the post ID. I hope this helps someone.