Skip Navigation

[Resolved] How to get the investigator link

This support ticket is created 2 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
- 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 6 replies, has 2 voices.

Last updated by franciscoP-3 2 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#2497311

Hi Luo,
ok perfect. Now the relationships are done. Thank you so much for your help and for your patiente.
We need two more things to get the proyect done, one of them I´ll try to make it by my own, but the other thing I need your help.

I know that I have to open a new ticket but I prefer that you help me because you know the project and maybe is more easy for you to help me than another supporter. So tell how to do it.

Anyway, the thing is how to get the investigator link to use it each time an investigator loggin and put this link in the button MY ACCOUNT.
Maybe is a shortcode that I can use, but I can't find it.

Thanks so much for your help.

#2497317

Hello,

I assume each "investigator" post author is different investigator user.

If it is, after each time an investigator login, you can redirect him to a page, in this page, display a post view:
- Query "investigator" posts
- Filter by post author is same logged-in user
- In view's loop, display the "investigator" post link

More help:
https://toolset.com/documentation/legacy-features/views-plugin/filtering-views-query-by-author/

#2497361
pic3.JPG
pic2.JPG
pic1.jpg

Hi Luo, thanks for answer.
Yes I did all that you comment.
I resolve adding the post slug to a a href:
[wpv-post-slug]

Thanks!

Just one more thing to finish. We created in the investigator template the creds child link form: Thesis, Articles, etc... and it works all perfect, but we notice an important security hole in this.

If I loggin as an investigator, I redirect to My Account and from here to the investigator template where I can add different content (thesis...) OK. But if I visit another investigator profile, I can see the same buttons and add a thesis from his profile.

The right thing is each investigator only can see those buttons in his own profile.

For example:
1.- I logging as Fernando and redirect to My Account. pic1.jpg
2.- Push "Añadir contenido" link (add content) and go to the investigator template. From here I can add different type of content. pic2.jpg
3.- From investigator Fernando I enter into other investigator profile, for example Dr Jose Peñaranda. pic3.jpg
4.- We need that those buttons only appears in the logged investigator profile.
5.- I add this code in every button:

[wpv-conditional if="( '[wpv-current-user info="logged_in"]' eq 'true' )"][cred_child_link_form form='1364' parent_id='-1' text='📝 Add Thesis' target='_self']
[/wpv-conditional]

But is not working for what we need.

Thanks.

#2497893

You can follow our document to control access to each post form for different user role:
https://toolset.com/course-lesson/controlling-access-to-front-end-forms/
Controlling Access to Front-End Forms in WordPress

#2498003
control-access.JPG

Hi Luo,
Yes I know about the control access forms and I managed all the permissions.
The problem is that the buttons to insert any custom post type keep display, we need that those buttons only appear in the current logged user, not in the others investigator template. Is there any possibility to do that?

Like display only if the investigator ID = current logged user ID or something like that.

Thanks.

#2498079

Hello,

You can setup the shortcodes like this:

[wpv-conditional if=" ( ( '[wpv-current-user info='id']' eq '[wpv-post-author format='meta' meta='ID' ]' ) ) "]
you are the post author, display something here...
[/wpv-conditional]

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-current-user
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-author

#2498113

Thank you so much Luo for your help, your patiente and for helping this rookie man in the world of toolset.
Thank you so much from spain!