Skip Navigation

[Resolved] Create a custom search view for users with custom user fields added

This support ticket is created 6 years, 6 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 2 voices.

Last updated by erikE-3 6 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#915248

Hi,
Got an urgent issue here...

So the client wants to have a contact database with all their employees available in their new intranet that we are building with toolset.
We are using the built in WordPress users in order to give all employees access to the intranet.
They are like 500 users and we have added custom user fields like "Division", "Country", "Business center", "Profile image" and "Title".

Now I'm thinking that it would be great if we could create a view with custom search for this. So that it would be easy to find each person using filters.

Is it possible to create a view and filter WordPress Users like this?
If not. Is it possible to create a custom post type and relate the users to a post type somehow (to make it filterable)?

OR do you have any other suggestion on how to create this searchable contact function.
We did another site using a custom search years ago that works fine, but those persons doesn't need an user account in WP, so they are made of a custom post type called "Contacts".

Thanks for you support!
//Pierre

#915362

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Eric,

Actually no its not possible to do a parametric search on Users however you can allow them to create profiles using the CPT and then search their profiles.

Please let me know if this helps.
Thanks,
Shane

#915607

Thanks Shane,
As I suspected then.

I've already made a solution using CPT in a previous project and it works fine (hidden link)
But for pure administration convenience this time, it would have been so much better if it was possible to use the default WP users. With CPT we'll need to add the user 2 times (one for wp-login and one for the CPT for parametric search) and as soon as an employee quits from the company, they have to remove him/her from two locations in WP.

But... can I somehow reuse data from WP users in my CPT? Like user e-mail and extra user fields etc.? Is it possible to add Users to a post type with post relationship?

#915907

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Eric,

If the user creates their own profiles then you won't need to re-add some of the custom fields. That is because we can get the user information through the post author.

However for the filterable information, this needs to be on the posts itself.

Users are already link to a CPT through the post author so there isn't another way to do this. Once a user is an author of a post we can pull information from their User.

Thanks,
Shane

#918279

Ok. We went on with creating a separate CPT for the users instead. So we will have both WP users and Employees (CPT)