Solution:
You need to use the view's filter hook "wpv_filter_query" in order to display the favorite posts of current loggedin user using the https://favoriteposts.com/ plugin.
So I was hoping to show my favorites (from this plugin: hidden link) in a Toolset View.
I saw that there's a filter that automatically appears on Views, called simplefavorites_count. However, when I use it to filter posts (simplefavorites_count > 0), the favorites of all users appear on all dashboards (instead of favorites of the current user). Also, it doesn't seem to remove posts when I unfavorite them.
Hello. Thank you for contacting the Toolset support.
Can you please tell me where you see the simplefavorites_count filter? Maybe a screenshot would help.
- Do you want to display all the favorite posts for the current logged-in user?
Hi Minesh, I uploaded the screenshot of where I find simplefavorites_count and how I set up the filter for it.
The goal is to display favorites of the currently logged in user in a custom View (hopefully exactly the same as the thumbnail View I set up for my custom type).
And I make few favorite posts but with my view, I do not see the custom field you shared in the screenshot.
Can you please share admin access details so I can check this further.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Hi Minesh, so I found an alternative solution that might be more straightforward.
Apparently there is an option to customize the display of favorites from the plugin. Maybe this is the better approach so I don't have to rely on Views to do the filtering, the plugin does it.
However, when I paste the template of the loop I currently have, the appearance is still not exactly the same. I have attached screenshots.
Here is the template I have from Toolset views (What it should look like):
I made adjustments to the shortcodes since the plugin doesn't use the [types...] configuration. Here's what I have so far (What it looks like right now):
That is the custom thing and requires custom adjustment. Maybe its better that you should approach the favorites plugin support and ask them how to customize their layout. Maybe Types shortcode should not be supported within that layout but better you check with the favorites plugin support and ask them how you can integrate those fields.
I see they support some dynamic fields but you need to check with them.
Hi Minesh, I already reached out to them but unfortunately they haven't responded. Also, most of the custom fields are already displaying properly (price, beds, baths) so maybe I'm just doing something wrong with the others?
If you can share access details and problem URL and share posts where it works and where the button does not work. I can try to check this further and guide you in the right direction.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Even after login I do not see anything on this page: hidden link
Can you please share the details which I asked in my previous reply:
problem URL and share posts where it works (as per your code) and where the button does not work. I can try to check this further and guide you in the right direction.
Hi Minesh, it works perfectly for logged in users, thank you very much :))
However, I also enabled Favorites for logged out users/guests. Based on the Favorite plugin's doc, this is saved in cookies instead of user meta. Is it possible to capture this in the view as well?
If not (or if it's too complex), I might just disable it for guests.
Otherwise, big thanks and appreciate the help so far :))