Also is a big job to create a post for each (300) user, is it possible to do it automatically, at least once?
If you have existing Users and you want to create posts for them automatically, you could export those Users somehow and create a CSV file. Then create the Clients custom post type. Then use a CSV import tool to import those entries as Clients.
How Can I add a hidden field on the registration form, so everyone that register on the platform, automatically create an "author post" ??
Okay I'm not sure what the hidden field is for, but I can show you another way. If you want to create the "Client" post automatically after the User Form is submitted, you can use the Forms API cred_save_data and the WordPress API wp_insert_post. Here is an example:
add_action('cred_save_data', 'create_client_post_auto',10,2);
function create_client_post_auto($user_id, $form_data)
{
if ($form_data['id']==12345)
{
// Create post object
$my_post = array(
'post_title' => $_POST['first_name'] . ' ' . $_POST['last_name'],
'post_status' => 'publish',
'post_author' => $user_ID,
'post_type' => 'client'
);
// Insert the post into the database
wp_insert_post( $my_post );
}
}
You would change 12345 to match the numeric ID of the create User Form, and you can change the post_title if you want. The post author field is automatically set to be the User just created by the User Form.
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
Still, don't understand how to add on the custom post form a field with:
- autosuggest input field (with the option to assign/select more than 1 author)
The related post autosuggest field only allows you to select one item at a time, and it will be displayed on a Relationship Form, not on the Form that creates a new post.
If you must be able to select more than one item at a time using an autosuggest field, the only other option I know of is a flat taxonomy.
- The final "community module post" has to show the list of authors with a link to their profile.
You can either use the proxy post single page as a profile, or you can use the WordPress Author Archive as a profile. If you want to use the proxy post, create a View of related proxy posts and place that View on the template for the Community Module post. In the View's loop, you can insert a link to each proxy post:
Client profile: [wpv-post-link]
If you want to use the WordPress Author archive instead of the proxy post, you will still create a View of proxy posts. This time, instead of inserting a link to the proxy post in the View loop, you will determine the author of that proxy post and insert a link to the author's archive:
<a href="/author/[wpv-post-author format='meta' meta='user_login']">[wpv-post-author format='meta' meta='user_login']</a><br />
Then you must create an author archive in Toolset > WordPress Archives.
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-author