Skip Navigation

[Resolved] custom search field "my own"

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 0.80 hours from now. Thank you for your understanding.

This topic contains 2 replies, has 2 voices.

Last updated by martinB-16 4 months ago.

Assigned support staff: Minesh.

Author
Posts
#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: English (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!