Skip Navigation

[Resolved] view display custom post type with author id and custom field

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.

Our next available supporter will start replying to tickets in about 5.04 hours from now. 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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 1 year, 4 months ago.

Assisted by: Waqar.

Author
Posts
#2618625
Screenshot from 2023-06-24 22-20-32.png

I am trying to list all transactions between two users.

There is a custom post type called transactions that has an author id that is the one who started the transaction and the payee-id that is receiving the transaction. I can show the transactions with the author_id, but i cannot with the wpcf-payee-id of the current user. How can i do that?

#2618865

Hi,

Thank you for contacting us and I'd be happy to assist.

In the query filter for the custom field, you'll specify the name of the shortcode attribute, for example, 'payee', and not the value (i.e. [wpv-current-user info='id'] ).
( screenshot: hidden link )

The value will be passed in the shortcode that loads the view, like this:
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-view )


[wpv-view name="Name of the view" payee="[wpv-current-user info='id']"]

Note: You'll replace the 'Name of the view' with the actual name of your target view.

regards,
Waqar

#2620057
Screenshot from 2023-06-29 16-02-20.png
Screenshot from 2023-06-29 16-02-42.png
Screenshot from 2023-06-29 16-02-58.png

Great, Waqar!

Now I have another thing to do. This list must show lines if the current user is the author or if it is the payee.

I have attached the prints of the view configuration, the page and the result.

Theoratically I need to use the filters post_author OR payeeid, but I think it is still tryng an AND.

New threads created by Waqar and linked to this one are listed below:

https://toolset.com/forums/topic/split-show-content-if-the-current-user-is-the-author-or-the-payee/

#2620695

Thanks for writing back and glad I could help.

I've created a separate ticket for your new question and will follow up on that shortly.
( ref: https://toolset.com/forums/topic/split-show-content-if-the-current-user-is-the-author-or-the-payee/ )

You're welcome to mark this ticket as resolved and start a new one, for each new question or concern.