Sauter la navigation

[Résolu] Best practices Post Fields vs. User Fields

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

I used "Post fields" rather than "User fields" and I'm having second thoughts. Should I use "User fields" for the profiles, which will be displayed and on an archive?

I need to make 3 different types of user profiles and want to be sure I'm doing this correctly before going further. All 3 profiles will be displayed and will have a search page (archive of users).

Side note: If it's better to use "user fields" for profiles, is there an easy way to move the custom fields from Post Fields to User Fields?

Solution:

User view does not support custom search form, so in your case, if you need to search on those fields, it is not recommended to move the custom fields from Post Fields to User Fields.

For example, you can create a normal user view, query wordpress user, should be able to see the message:

Only Views listing posts can have custom search inputs.

And since the post fields and user fields are stored in different database table: wp_usermeta, wp_postmeta.

So there isn't a easy way to move the custom fields from Post Fields to User Fields, you will need to setup them manually.

Relevant Documentation:

https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

This support ticket is created Il y a 5 années et 2 mois. 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par MargeP6083 Il y a 5 années et 2 mois.

Assisté par: Luo Yang.

Auteur
Publications
#1373545

I'm creating a user profiles with several fields. This post is where I began as a model: https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

I used "Post fields" rather than "User fields" and I'm having second thoughts. Should I use "User fields" for the profiles, which will be displayed and on an archive?

I need to make 3 different types of user profiles and want to be sure I'm doing this correctly before going further. All 3 profiles will be displayed and will have a search page (archive of users).

Side note: If it's better to use "user fields" for profiles, is there an easy way to move the custom fields from Post Fields to User Fields?

Thanks!

#1373621

Hello,

User view does not support custom search form, so in your case, if you need to search on those fields, it is not recommended to move the custom fields from Post Fields to User Fields.

For example, you can create a normal post view, query wordpress user, should be able to see the message:

Only Views listing posts can have custom search inputs.

And since the post fields and user fields are stored in different database table: wp_usermeta, wp_postmeta.

So there isn't a easy way to move the custom fields from Post Fields to User Fields, you will need to setup them manually.

#1374343

My issue is resolved now. Thank you!