Saltar navegación

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

This support ticket is created 3 years, 3 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
- 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 -

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 7 respuestas, tiene 2 mensajes.

Última actualización por chelhwanS 3 years, 3 months ago.

Asistido por: Minesh.

Autor
Mensajes
#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
enlace oculto

I made a staging site. URL is
enlace oculto

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.

enlace oculto

#2562257

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: 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.
enlace oculto

However, in the view, it comes out abnormally.
enlace oculto

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

#2562819

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: 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:
- enlace oculto

Please check the following screenshot: enlace oculto

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.

enlace oculto

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
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

What if you disable the caching of your view?

Please check the following screenshot: enlace oculto

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.