That worked!
I changed:
//search drafts
function se_search_draft_posts( $where ) {
global $wpdb;
if ( !empty( $this->query_instance->query_vars['s'] ) ) {
$where = str_replace( '"', '\'', $where );
if ( !$this->wp_ver28 ) {
$where = str_replace( " AND (post_status = 'publish'", " AND ((post_status = 'publish' OR post_status = 'draft')", $where );
}
else {
$where = str_replace( " AND ($wpdb->posts.post_status = 'publish'", " AND ($wpdb->posts.post_status = 'publish' OR $wpdb->posts.post_status = 'draft'", $where );
}
$where = str_replace( " AND (post_status = 'publish'", " AND (post_status = 'publish' OR post_status = 'draft'", $where );
}
$this->se_log( "drafts where: ".$where );
return $where;
}
to:
//search drafts
function se_search_draft_posts( $where ) {
global $wpdb;
if ( !empty( $this->query_instance->query_vars['s'] ) ) {
$where = str_replace( '"', '\'', $where );
if (current_user_can('edit_posts')):
if ( !$this->wp_ver28 ) {
$where = str_replace( " AND (post_status = 'publish'", " AND ((post_status = 'publish' OR post_status = 'draft')", $where );
}
else {
$where = str_replace( " AND ($wpdb->posts.post_status = 'publish'", " AND ($wpdb->posts.post_status = 'publish' OR $wpdb->posts.post_status = 'draft'", $where );
}
$where = str_replace( " AND (post_status = 'publish'", " AND (post_status = 'publish' OR post_status = 'draft'", $where );
endif; //end of added condition
}
$this->se_log( "drafts where: ".$where );
return $where;
}