| @@ -26,8 +26,23 @@ | ||
| 26 | 26 | 'label' => __('Name', 'wpdirectorykit'), |
| 27 | 27 | 'rules' => 'required' |
| 28 | 28 | ), |
| 29 | 29 | array( |
| 30 | + 'field' => 'is_multiline_enabled', | |
| 31 | + 'label' => __('Multiline enabled', 'wpdirectorykit'), | |
| 32 | + 'rules' => '' | |
| 33 | + ), | |
| 34 | + array( | |
| 35 | + 'field' => 'is_label_disable', | |
| 36 | + 'label' => __('Show only icons', 'wpdirectorykit'), | |
| 37 | + 'rules' => '' | |
| 38 | + ), | |
| 39 | + array( | |
| 40 | + 'field' => 'is_show_agent_details', | |
| 41 | + 'label' => __('Show agent details', 'wpdirectorykit'), | |
| 42 | + 'rules' => '', | |
| 43 | + ), | |
| 44 | + array( | |
| 30 | 45 | 'field' => 'resultitem_json', |
| 31 | 46 | 'label' => __('Search Form Json/Structure', 'wpdirectorykit'), |
| 32 | 47 | 'rules' => '' |
| 33 | 48 | ), |
| @@ -34,10 +49,14 @@ | ||
| 34 | 49 | ); |
| 35 | 50 | |
| 36 | 51 | if($this->form->run($rules)) |
| 37 | 52 | { |
| 53 | + | |
| 54 | + // Check _wpnonce | |
| 55 | + check_admin_referer( 'wdk-resultitem-edit_'.$id, '_wpnonce' ); | |
| 56 | + | |
| 38 | 57 | // Save procedure for basic data |
| 39 | - $data = $this->resultitem_m->prepare_data($this->input->post(), $rules); | |
| 58 | + $data = $this->resultitem_m->prepare_data(wdk_get_post(), $rules); | |
| 40 | 59 | |
| 41 | 60 | // Save standard wp post |
| 42 | 61 | |
| 43 | 62 | if($this->resultitem_m->total() == 0) |
| @@ -45,11 +64,12 @@ | ||
| 45 | 64 | $id = NULL; |
| 46 | 65 | $data['idresultitem'] = 1; |
| 47 | 66 | } |
| 48 | 67 | |
| 68 | + | |
| 49 | 69 | $insert_id = $this->resultitem_m->insert($data, $id); |
| 50 | 70 | |
| 51 | - // redirect | |
| 71 | + // redirect | |
| 52 | 72 | |
| 53 | 73 | if(!empty($insert_id) && empty($id)) |
| 54 | 74 | { |
| 55 | 75 | wp_redirect(admin_url("admin.php?page=wdk_resultitem&id=$insert_id&is_updated=true")); |