Skip Navigation

[Gelöst] custom search field "my own"

This support ticket is created vor 3 Jahre, 1 Monat. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 2 Antworten, has 2 Stimmen.

Last updated by martinB-16 vor 3 Jahre.

Assisted by: Minesh.

Author
Artikel
#1988265

Hi,

I would like a search field (checkbox) "my own" in a view.

If the check box is selected, only those posts should be displayed for which the logged in user is the author.

How do I do that?

#1988519

Minesh
Supporter

Languages: Englisch (English )

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

Hello. Thank you for contacting the Toolset support.

Toolset offers the Query Filter to filter the posts by author and then you can set this author Query Filter to filter the posts by loggedin users.
=> https://toolset.com/documentation/user-guides/views/filtering-views-query-by-author/

The thing is that we do not have frontend filter (checkbox) to filter the post by current user.

Maybe, what if you create a new page "My Own Posts" and create another view "view-my-own-post" and with this view you add the author filter as shown above and add this view to the page "My Own Posts".

Then add link to that page ("My Own Posts") instead of checkbox and when you click on this it will redirect you to that page that will display the own post.

if the above option does not look good, then the another option would be, we can add a checkbox to your current view and submit button.

<input type="checkbox" name="my-posts" id="my-posts" class="js-wpv-filter-trigger form-check-input" value="1" />

And we will use the wpv_filter_query to hook the author filter dynamically.

Please let me know with what option you would like to go with and if you want to go with the checkbox option then I will require admin access details and to what view you want to add checkbox (my-own) filter and to what page you added your current view.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin 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.

#1996787

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.