Skip Navigation

[Resolved] custom user fields do not show when added in a page block

This support ticket is created 3 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 – 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)

This topic contains 14 replies, has 2 voices.

Last updated by Luo Yang 3 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1788009
Screen shot user custom field 2020092301.png

Tell us what you are trying to do?
Created custom user field as a test
Is there any documentation that you are following?
I tried all available documentation as much as possible
Is there a similar example that we can see?
/I uploaded an image and you can see example at: hidden link
What is the link to your site? hidden link

#1788149

Hi,
Just to elaborate on the issue:
I am trying to create custom fields to be added to Woocommerce my account page and have new customers fill in these fields when signing up and then be able to view these fields any time in my account account details screen anytime and also have these fields available to admin on the back end user profile screen.

When I added custom user fields they show fine on the backend admin user profile as intended. I then used Toolset block to add these fields on a page to test how they will show on a regular WP page using your Toolset blocks. The will not show unless I go through admin user profile screes and add some value in the field. Otherwise a bank field (for a new user for example) will not show on the added page. Also the field does not show field label: only the field data if I added it.
I hope this explains the case clearly.
Thanks,

#1788593
user-field.JPG

Hello,

I assume we are talking about Toolset "Fields and Text" block, I have tried it in my localhost with a fresh WP installation + the latest version of Toolset plugins, with below steps:
1) Create a custom user field
2) Edit my profile, setup value in above custom user field
3) Create a page, add a Toolset "Fields and Text" block, insert the custom user field shortcode with option "The current logged in user", see my screenshot user-field.JPG, it works fine in both front-end and admin side, I can see the value displaying correctly.

Is there anything missing?

#1789449

Hi,
The test you applied is similar to what I have in my original message. The problem I am facing does not happen if I go to my profile (or any user profile) and add a value to the added custom field. In this case the value will show in a front end screen.
The issue happens if I add a custom field and then ask any user to look at front end page to edit that field. In this case I did not add any data/ value to the field from back end as admin. The user trying to see field from front end will not see anything as the field is still empty.
The other issue I mentioned in my message earlier is that the field label does not show in front end screens or pages.
Thanks,

#1789801

Q1) The user trying to see field from front end will not see anything as the field is still empty.
Since the custom user field is empty, so it is expected result: it displays empty value in front-end, and your user will not see any value in front-end.

Q2) The other issue I mentioned in my message earlier is that the field label does not show in front end screens or pages.
Types shortcode [types ...][/types] does not output field label, see our document:
https://toolset.com/documentation/customizing-sites-using-php/functions/

You can setup the label manually, for example:
My field label: [types usermeta=’my-field’ current_user=’true’][/types]

#1789841

Q1) The user trying to see field from front end will not see anything as the field is still empty.
Since the custom user field is empty, so it is expected result: it displays empty value in front-end, and your user will not see any value in front-end.

-In this case how can users add their own data in custom fields for the first time? The field is not showing and no edits are available. Also when I add a placeholder in the field definition it is not showing in front end. What is the use of place holder available in custom field definition screen? Shouldn't the placeholder show in place of the field data and allow user to replace it with user input data? We need to help the user add data not show them pre-populated fields. How can we do that?

Q2) The other issue I mentioned in my message earlier is that the field label does not show in front end screens or pages.
Types shortcode [types ...][/types] does not output field label, see our document:
https://toolset.com/documentation/customizing-sites-using-php/functions/

-I read the document but did not understand how can I add a short code to show field name/ label before showing field data. Can you please show me an example on how to do that?

#1789843

Note: I am using hidden link to test adding custom fields.
Thanks,

#1789977

You can ask your user to edit their profile to fill the custom user field value, you can setup Toolset user form for user to edit their own profile:
https://toolset.com/course-lesson/using-forms-to-create-an-edit-your-profile-page/

I have already provide example above, Q2) :
https://toolset.com/forums/topic/custom-user-fields-do-not-show-when-added-in-a-page-block/#post-1789801
You will need to setup the label manually with HTML codes or text.

#1792351
Screen shot Woocommerce My account 2020092701.png

Hi,

I have used the User forms and create a new user form. How can I use this form in place of Woocommerce My account screen without losing the links available in the left column from Woocommerce. I attached a screen shot showing these links usually available from Woocommerce My account screen.

Thanks,

#1792393

You can edit the page you mentioned in screenshot:
https://toolset.com/wp-content/uploads/2020/09/1792351-Screen_shot_Woocommerce_My_account_2020092701.png

And insert your user form shortcode, for example:
[cred_user_form form="edit-user-form" ]

More help:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_form

#1792395
Screen shot Woocommerce My account 2020092703.png
Screen shot Woocommerce My account 2020092702.png

When I edit the page and add the short code it does not show the form. Please see attachments.

Thanks,

#1792429

It is only an example, you will need to replace the "edit-user-form" with your own user form's title/slug, see the document I mentioned above:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_form

#1792431

I am aware this is an example. My form name is "edit-user-profile" as in the image I attached earlier.

New threads created by Luo Yang and linked to this one are listed below:

https://toolset.com/forums/topic/setup-user-form-in-woocommerce-account-page/

#1792433
edit-user-form.JPG

I have tried it in my localhost with a fresh WP installation + the latest version of Toolset plugins + Woocommerce plugin, it works fine, see my screenshot edit-user-form.JPG

So the problem you mentioned above is abnormal, please check these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

4) If the problem still persists, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only, also point out the problem page URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1792495

According to our support policy
https://toolset.com/toolset-support-policy/
we prefer one ticket one question, I assume the original questions of this thread is resolved:
https://toolset.com/forums/topic/custom-user-fields-do-not-show-when-added-in-a-page-block/#post-1788009

For the new questions, please check the new thread here:
https://toolset.com/forums/topic/setup-user-form-in-woocommerce-account-page/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.