• Hi there,

    I’m just trying to get this set up with an existing (live) site. I’m only really interested in the admin search options, and I’m not sure how it’s supposed to behave.

    I’m using the Awesome Support plugin, which creates custom post types called Tickets. I made sure to check all the relevant post types to yes for Indexing options, in the settings (though for the record, they are public = no). I indexed my site. Then I went to the admin page for the Tickets List and tried the built-in search box. I typed in some text that should have matched a Title for a ticket, and it returned no results. I tried searching for some Content, and it returned no results. Then I tried the same procedure for a Page, and it worked fine. And I tried again with a different custom post type, Events, which also worked fine.

    So I wonder if it has to do with the public = no problem? or if i haven’t indexed correctly?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter kingstonnexus

    (@kingstonnexus)

    Update:

    I found this article: https://www.relevanssi.com/knowledge-base/private-posts-custom-post-types/ and I added the following function:

    add_filter('relevanssi_private_cap', 'private_ticket_cap');
    
    function private_ticket_cap($cap) {
    	if ($cap == 'read_private_ticket') $cap = 'view_private_ticket';
    	return $cap;
    }

    But it still seems to be not working. I also tried read_private_tickets and view_private_tickets. I also tried reindexing. Any help?

    According to Awesome Support documentation, the relevant permissions are:
    view_private_ticket
    view_ticket

    Plugin Author Mikko Saari

    (@msaari)

    public set to no can be a problem, yes, but try unchecking the “Respect ‘exclude_from_search'” option –?that’s probably causing the problem.

    Setting the private_cap filter to view_private_cap may also be necessary.

    Thread Starter kingstonnexus

    (@kingstonnexus)

    Okay I tried unchecking Respect exclude_from_search, but that didn’t work.

    How do I set the private_cap filter?

    Plugin Author Mikko Saari

    (@msaari)

    Sorry, not view_private_cap, but view_private_ticket. That’s the function you already found. If that function is in place with the $cap set to view_private_ticket and “Respect ‘exclude_from_search'” is unchecked and you’ve rebuilt the index and it still doesn’t work, that’s pretty much as much as I can help without debugging this on your site.

    Does the search for private tickets work on the frontend?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Admin search with private CPTs?’ is closed to new replies.