Wallmander\ElasticsearchIndexer\Model\Indexer::getSearchablePostTypes PHP Method

getSearchablePostTypes() public static method

public static getSearchablePostTypes ( ) : array
return array
    public static function getSearchablePostTypes()
    {
        return get_post_types(['exclude_from_search' => false]);
    }

Usage Example

 public static function argPostType(Query $query, $value, &$q)
 {
     if ($value == 'any' || isset($value[0]) && $value[0] == 'any') {
         $pt = Indexer::getSearchablePostTypes();
         $query->where('post_type', array_values($pt));
     } else {
         $query->where('post_type', $value);
     }
 }