Skip Navigation

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

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by chelhwanS 1 year, 9 months ago.

Assisted by: Minesh.

Author
Posts
#2561277

I am trying to:

Even if the user is different, the user ID value is the same.
If I edit the page, the User ID value changes, and the value comes out the same even if the user is different.

The page URL is
hidden link

I made a staging site. URL is
hidden link

Link to a page where the issue can be seen:
https://toolset.com/forums/topic/the-user-id-does-not-change-in-view-block/

#2562039

If it is not a view block, it works normally.

hidden link

#2562257

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I would like to know that what user ID you would like to display and with what field?

Do you want to display the post author ID or current loggedin user ID?

#2562637

I want to show login user id.

The code to use is [wpv-current-user info="id"].

It appears normally on the normal screen.
hidden link

However, in the view, it comes out abnormally.
hidden link

Both use the same code [wpv-current-user info="id"].

#2562819

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

The shortcode [wpv-current-user info="id"] will return the user ID when you are logged in.

If you will visit the page as non-loggedin (guest) user it will not return user ID as user is not logged in.

When I loggedin using the access details you shared I can see the user ID is 12:
- hidden link

Please check the following screenshot: hidden link

Do you mean you want to display the ID of post author? or what ID you want to show when user is not logged in?

#2563405

I guess the explanation was insufficient. I will explain by attaching a video.

hidden link

1. Log in with ID: test. user-ID is "5"
At this time, "5" appears in both general and view block.

2. Log in with ID:test1, The user ID is "11".
At this time, "11" appears in general,
View shows "5".

I don't know why, but it seems that View remembers the first logged in user-ID: 5.

After that, even if I log in with a different ID, it shows as "5". In some cases, you may see a different number than the user ID you logged in with.

And this phenomenon only appears in View.

If I modify the View, it looks normal without the above phenomenon. Sometimes it even appears.

#2563595

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

What if you disable the caching of your view?

Please check the following screenshot: hidden link

If that does not help - I will require admin access details to your site where I can see the issue with the access details of test and test1 user.

#2563675

My issue is resolved now. Thank you!

It was a simple matter,
I made a mistake.

Thank you and sorry.