Skip Navigation

[Resolved] REAL ESTATE WEBSITE Agents front page and Users profil

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Author
Posts
#1955471

I use the Toolset Real Estate sample site.
This site is private and is only used by real estate agents.

What I want to do?
When a real estate agent logs in the website he creates his account with his photo, email, phone number...
I want to display a view with all the users/agents on a page name "Our agents" on the front end.
To say it another way, I want to link users to the agents page of the site.

Is there any documentation that you are following?
I follow all the courses available and search on the support..

What is the link to your site?
efficityoffmarket.com
The website is open for now, I will allow access only for the users later

#1955977

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

When you say you want to link users with Agents.

Do you have Agents configured as custom post type?

#1955997

Dear Minesh,
yes I have a custom post type for Agents.

I would like that when a new subscriber creates his account on the front end of the website with the CRED form it automatically creates an Agents profile for him.

#1956029

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You can use the Toolset Form's API hook: cred_save_data

You can add your custom code to "Custom Code" section. Please check the following doc:
=> https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/

add_action('cred_save_data', 'func_add_new_agent_on_registration',10,2);
function func_add_new_agent_on_registration($post_id, $form_data) {
 
    if ($form_data['id']==9999){
  
   $user_id = $post_id;

// Create new entry after registration.
$my_post = array(
  'post_title'    => $_POST['user_login'],
  'post_content'  => '',
  'post_status'   => 'publish',
  'post_author'   => $user_id,
  'post_type' => 'your-agent-post-type-slug'
);
       
// Insert the post into the database
wp_insert_post( $my_post );
 }

Where:
-Replace 9999 with your original User form ID
- Replace your-agent-post-type-slug with your original agent custom post type slug

You can adjust the code as per your requirement.

Please check the following related ticket.
https://toolset.com/forums/topic/creating-a-custom-post-type-with-cred-and-user-registration-at-the-same-time/#post-1182310

#1956059

Thank you Minesh.
I don't think I'll be able to do that at the moment and use Custom Code.
I will manage this manually for the moment and I'll come back to this later maybe.

#1956061

I know how to do it and I will try later.