public function postSearch($options) { $result = null; if (!empty($options['plugin'])) { if (!empty($options['plugin'][$this->id])) { $result = array(); $result['join'] = array(); $category_model = new blogCategoryModel(); if ($category = $category_model->getByField('url', $options['plugin'][$this->id], 'id')) { $result['join'] = array(); $result['join']['blog_post_category'] = array('condition' => 'blog_post_category.post_id = blog_post.id'); $result['where'] = array('blog_post_category.category_id IN (' . implode(', ', array_keys($category)) . ')'); } else { $category = array(); $result['where'] = 'FALSE'; } $title = array(); if ($category) { foreach ($category as $item) { $title[] = $item['name']; } } else { $title[] = _wp('not found'); } wa()->getResponse()->setTitle(implode(', ', $title)); } } return $result; }