Automatically assign author as manager of a project

In some cases, it can be useful that an author of a project automatically becomes its manager. Here is an example of how you could achieve that.

/**
 * Automatically assign author as manager of a project
 * @param $project_id
 * @param $project
 */
function custom_cuar_assign_author_to_project($project_id, $project) {
    $current_user = wp_get_current_user();
    $project->add_actor_to_project($current_user->ID, 'manager');
}
add_action('cuar/private-content/projects/on-project-created', 'custom_cuar_assign_author_to_project', 10, 2);