| @@ -118,8 +118,13 @@ | ||
| 118 | 118 | 'field' => 'category_color', |
| 119 | 119 | 'label' => __('Color', 'wpdirectorykit'), |
| 120 | 120 | 'rules' => '' |
| 121 | 121 | ), |
| 122 | + array( | |
| 123 | + 'field' => 'titles_for_search', | |
| 124 | + 'label' => __('Alternative titles for search', 'wpdirectorykit'), | |
| 125 | + 'rules' => '' | |
| 126 | + ), | |
| 122 | 127 | ); |
| 123 | 128 | |
| 124 | 129 | if($this->form->run($rules)) |
| 125 | 130 | { |
| @@ -132,9 +137,9 @@ | ||
| 132 | 137 | if(empty($id) && strpos($data['category_title'], ',') !== FALSE) { |
| 133 | 138 | |
| 134 | 139 | foreach (explode(',', $data['category_title']) as $title) { |
| 135 | 140 | // Save standard wp post |
| 136 | - $insert_id = $this->category_m->insert(array_merge($data, array('category_title' => $title)), NULL); | |
| 141 | + $insert_id = $this->category_m->insert(array_merge($data, array('category_title' => trim($title))), NULL); | |
| 137 | 142 | } |
| 138 | 143 | wp_redirect(admin_url("admin.php?page=wdk_category&is_updated=true&custom_message=".urlencode(esc_html__('Bulk Categories added', 'wpdirectorykit')))); |
| 139 | 144 | exit; |
| 140 | 145 | } else { |