• Resolved kevin98lude

    (@kevin98lude)


    I’m having an issue with the admin search feature. I have a post type called vehicles. When I search, for example using a stock number, any vehicle set to ‘private’ does not show up. Any ‘public’ vehicles show as expected. Is there a way to allow private posts results in the admin.

    http://wordpress.org/plugins/relevanssi/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mikko Saari

    (@msaari)

    What is the capability type of your custom post type? Relevanssi is assuming the capability is “read_private_POSTTYPEs”, which is causing the problems here.

    If you want a quick fix, edit lib/common.php in Relevanssi. Find this bit of code:

    if (in_array($status, array('draft', 'pending', 'future')) && is_admin()) {
    		$post_ok = true;
    }

    and change it to:

    if (in_array($status, array('draft', 'pending', 'future', 'private')) && is_admin()) {
    		$post_ok = true;
    }

    For the next version, I’ll come up with something more robust here.

    Plugin Author Mikko Saari

    (@msaari)

    Actually, forget that. Here’s a new version of common.php that should fix the problem. Please try replacing your current lib/common.php with this file and let me know if that helps:

    https://dl.dropboxusercontent.com/u/9585896/common.php

    Thread Starter kevin98lude

    (@kevin98lude)

    Thank you.

    The new common.php file worked after removing the . ‘s’ from the line: $cap = 'read_private_' . $type it

    The .’s’ would have worked if I wouldn’t have changed the post type name from vehicle to vehicles sometime ago.

    Plugin Author Mikko Saari

    (@msaari)

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Admin Search – No results returned for private posts’ is closed to new replies.