| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* Trait: Search Content Settings |
| 8 |
*/ |
| 9 |
trait Jobwp_Search_Content_Settings |
| 10 |
{ |
| 11 |
protected $fields, $settings, $options; |
| 12 |
|
| 13 |
protected function jobwp_set_search_content_settings( $post ) { |
| 14 |
|
| 15 |
$this->fields = $this->jobwp_search_content_option_fileds(); |
| 16 |
|
| 17 |
$this->options = $this->jobwp_build_set_settings_options( $this->fields, $post ); |
| 18 |
|
| 19 |
$this->settings = apply_filters( 'jobwp_search_content', $this->options, $post ); |
| 20 |
|
| 21 |
return update_option( 'jobwp_search_content', serialize( $this->settings ) ); |
| 22 |
|
| 23 |
} |
| 24 |
|
| 25 |
function jobwp_get_search_content_settings() { |
| 26 |
|
| 27 |
$this->fields = $this->jobwp_search_content_option_fileds(); |
| 28 |
$this->settings = stripslashes_deep( unserialize( get_option('jobwp_search_content') ) ); |
| 29 |
|
| 30 |
return $this->jobwp_build_get_settings_options( $this->fields, $this->settings ); |
| 31 |
} |
| 32 |
|
| 33 |
protected function jobwp_search_content_option_fileds() { |
| 34 |
|
| 35 |
return [ |
| 36 |
[ |
| 37 |
'name' => 'jobwp_hide_search_panel', |
| 38 |
'type' => 'boolean', |
| 39 |
'default' => false, |
| 40 |
], |
| 41 |
[ |
| 42 |
'name' => 'jobwp_hide_search_keyword', |
| 43 |
'type' => 'boolean', |
| 44 |
'default' => false, |
| 45 |
], |
| 46 |
[ |
| 47 |
'name' => 'jobwp_search_keyword_ph', |
| 48 |
'type' => 'text', |
| 49 |
'default' => 'Keyword', |
| 50 |
], |
| 51 |
[ |
| 52 |
'name' => 'jobwp_hide_search_category', |
| 53 |
'type' => 'boolean', |
| 54 |
'default' => false, |
| 55 |
], |
| 56 |
[ |
| 57 |
'name' => 'jobwp_search_category_ph', |
| 58 |
'type' => 'text', |
| 59 |
'default' => 'All Job Category', |
| 60 |
], |
| 61 |
[ |
| 62 |
'name' => 'jobwp_hide_search_jobtype', |
| 63 |
'type' => 'boolean', |
| 64 |
'default' => false, |
| 65 |
], |
| 66 |
[ |
| 67 |
'name' => 'jobwp_search_jobtype_ph', |
| 68 |
'type' => 'text', |
| 69 |
'default' => 'All Job Type', |
| 70 |
], |
| 71 |
[ |
| 72 |
'name' => 'jobwp_hide_search_location', |
| 73 |
'type' => 'boolean', |
| 74 |
'default' => false, |
| 75 |
], |
| 76 |
[ |
| 77 |
'name' => 'jobwp_search_location_ph', |
| 78 |
'type' => 'text', |
| 79 |
'default' => 'All Job Location', |
| 80 |
], |
| 81 |
[ |
| 82 |
'name' => 'jobwp_search_button_txt', |
| 83 |
'type' => 'text', |
| 84 |
'default' => 'Search Job', |
| 85 |
], |
| 86 |
[ |
| 87 |
'name' => 'jobwp_hide_search_level', |
| 88 |
'type' => 'boolean', |
| 89 |
'default' => false, |
| 90 |
], |
| 91 |
[ |
| 92 |
'name' => 'jobwp_search_level_ph', |
| 93 |
'type' => 'text', |
| 94 |
'default' => 'All Job Level', |
| 95 |
], |
| 96 |
]; |
| 97 |
} |
| 98 |
} |