

// // always set file author to post author (share edit permission )


// add_filter('voxel/file-field/attachment-args', function ($insert_attachment_args, $instance) {
//     // Check if $instance has the method get_post
//     if (!method_exists($instance, 'get_post')) {
//         return $insert_attachment_args; // Return early if get_post doesn't exist
//     }

//     // Ensure $instance->get_post() returns a valid object and has the method get_author_id()
//     $post = $instance->get_post();
//     if (is_object($post) && method_exists($post, 'get_author_id')) {
//         $insert_attachment_args['post_author'] = $post->get_author_id();
//     }

//     return $insert_attachment_args;
// }, 10, 2);
