Fill user field by admin
-
Hello,
is it possible to create a field for each user profile, that can only be filled and edited by the admin but seen by the user? I’m looking for a way to give every user a static, individual info that is only visible for themselves.
-
Hi,
Thank you for contacting us1
To add an additional field for the user, you need to do the following.
Please go to the plugin settings page ( “BWS Panel” > “Profile Extra Fields” ) and click ‘Add a new field’button.
Then, in the “Field Properties” option, select the necessary permissions for the user role you need. Activate the corresponding checkboxes to display this field for the user role. Save the changes. This field is now available for the user role you selected. https://prnt.sc/j03cxj.
For example, create the “age” field so that it displays only for the “Subscriber” user role. Create a new field named “Age”, activate the checkboxes for the “Subscriber” role. In this case, “Subscriber” can edit the field and view it. If you want to prevent this field from being edited, you must deactivate the “Editable” checkbox. This field is now only available for the Subscriber user role https://prnt.sc/j03hut.
Oh, great. Thank you very much for the detailed explanation. My fault was to not activate the Availability for the administrator so I couldn’t activate Editable neither.
So the main part works now as I wish: I can fill the field in the users’ profile and they can see it but not change it.
Then I played around with the shortcode with the idea to show each user the content of its field inside a page. Is there a wildcard that replaces the value behind user_id= with the current user? I tried [prflxtrflds_user_data user_id=get_current_user] but that shows all the users even if they are not logged in. And [prflxtrflds_user_data user_role=familie,vertraute user_id=get_current_user_id] what does not work at all.
Hi,
Is there a wildcard that replaces the value behind user_id= with the current user?
Maybe assigning a specific user role to a specific user will help?
I don’t understand. For sure I don’t want to assign every user a specific role.
No, the idea is to have one page for all users with one shortcode that shows the value of the chosen field depending on the logged-in user who is opening this page.
Even if I would assign specific roles wouldn’t that mean to have a shortcode for each role or a wildcard for the user_role tag?
Would it work to get the WP user_id by some code in the template that put it in a variable and use this variable in the shortcode?
Hi.
If we understood you correctly, you need to create one page for all users with one shortcode that shows the value of the chosen field depending on the logged-in user who is opening this page.
Please try to use the shortcode [prflxtrflds_field field_id=*] on that page, where field_id is ID of your custom field. This way the value of the custom field for the user is only visible for themselves if the user has this permission on Field Properties plugin settings.
Let us know about the result.
Yes, you understood correctly. That is exactly what I want.
And I tried [prflxtrflds_field field_id=1] with the result that nothing is shown. I logged in with a user that has a value for this field (visible in his profile) but nothing is shown at the page with the shortcode. Also nothing in the source code of the page, just an extra <br>, I guess.
I tried then with [prflxtrflds_field field_id=1 user_id=2] where 2 is the ID of the WP user, but still nothing. Also not for the administrator.
I rechecked the field’s settings and enlarged the properties, activated that it is shown by default and always shown (in User Data) but can’t make it appear on a page.
Hi,
Unfortunately, we cannot reproduce this problem on our local environment. Please provide the access credentials to your WordPress admin dashboard (with Administrator’s permissions) and the FTP credentials (host, username, and password), in order to detect the reason and find the solution.
During making tests we’ll probably deactivate some of your plugins or switch the theme. That’s why before giving the access, we recommend you to make a full backup of your site.
Since this data is confidential, maybe, it would be better if you create a private ticket on our support forum (https://support.bestwebsoft.com/hc/en-us/requests/new). Please include a link to this post, so that we could recall the case immediately.
Hello,
thanks for that offer but I am not interested in that kind of support. Changing to a default theme and deactivating plugin is also in my abilities. And while I was starting to do so I discovered accidentally that the info from the field is shown on the page but totally on top as first word and not at the place in the text where I put the shortcode.
How could I influence that?
Hi,
We were able to detect the problem. It will be fixed in the future plugin update. Thank you for informing us about this issue.
Okay, great. I am looking forward to it.
The topic ‘Fill user field by admin’ is closed to new replies.