Skip Navigation

[Resolved] The user ID does not change in View Block

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 5 replies, has 2 voices.

Last updated by chelhwanS 2 years ago.

Assisted by: Luo Yang.

Author
Posts
#2494147

I downgraded to WordPress 6.0
field and text block works fine.

However, it appears differently in the View block.
The video below explains this

Although the content is the same, the user ID does not change in the View block.
When I log in with a different ID, the user ID changes in general posts, but does not change in View Block.

The video below explains this

hidden link

#2494151

Hello,

I assume we are talking about the shortcode [wpv-user field="ID"] in your video capture.
It is expected to display current logged-in user's ID, see our document:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-user

If the shortcode is inside a <strong>Views user query</strong>, it will display information for the user found in loop. Otherwise it will display information for the current logged-in user or the user with the specific id, when id attribute is set.

If you are going to display the current post's author ID, please replace it with shortcode [wpv-post-author format="meta" meta="ID"]

See our document:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-author

#2494193

I'm not trying to show the post author ID. I want to show the logged in user ID.
The logged in user has changed, but the changed user ID is not visible, but only a specific user ID.

and
It only appears in the ViewBlock.
*******
Below is a post for testing.
hidden link

ID list for test

ID: test pass : neturetest1!
ID: test1 pass : neturetest1!
ID: test2 pass : neturetest1!
ID: test3 pass : neturetest1!

#2494219
test1.JPG

I don't see those text you mentioned above.

See my screenshot: test1.jpg

And I have tried the credentials in you provided in previous thread:
https://toolset.com/forums/topic/field-and-text-block-not-working/#post-2492623
It is not valid, I get below error message:
등록되지 않은 이메일이거나 비밀번호가 잘못되었습니다.
Please check it, make sure it is a valid admin account.

#2496619

Thanks for the details, I have done below modifications in your website:
Edit the page:
hidden link
find and select view block, in the block setting panel, disable option "Cache View"
Test it in frontend:
hidden link
It works fine, I see correct user ID 12 in view's loop

And in your case, I suggest you replace the shortcode from:
[wpv-user field="ID"]
To:
[wpv-current-user info="id"]
See our document:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-current-user

#2497337

My issue is resolved now. Thank you!