| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* Trait: Search Styles Settings |
| 8 |
*/ |
| 9 |
trait Jobwp_Search_Styles_Settings |
| 10 |
{ |
| 11 |
protected $fields, $settings, $options; |
| 12 |
|
| 13 |
protected function jobwp_set_search_styles_settings( $post ) { |
| 14 |
|
| 15 |
$this->fields = $this->jobwp_search_styles_option_fileds(); |
| 16 |
|
| 17 |
$this->options = $this->jobwp_build_set_settings_options( $this->fields, $post ); |
| 18 |
|
| 19 |
$this->settings = apply_filters( 'jobwp_search_styles', $this->options, $post ); |
| 20 |
|
| 21 |
return update_option( 'jobwp_search_styles', $this->settings ); |
| 22 |
|
| 23 |
} |
| 24 |
|
| 25 |
function jobwp_get_search_styles_settings() { |
| 26 |
|
| 27 |
$this->fields = $this->jobwp_search_styles_option_fileds(); |
| 28 |
$this->settings = get_option('jobwp_search_styles'); |
| 29 |
|
| 30 |
return $this->jobwp_build_get_settings_options( $this->fields, $this->settings ); |
| 31 |
} |
| 32 |
|
| 33 |
protected function jobwp_search_styles_option_fileds() { |
| 34 |
|
| 35 |
return [ |
| 36 |
[ |
| 37 |
'name' => 'jobwp_search_btn_bg_color', |
| 38 |
'type' => 'text', |
| 39 |
'default' => '#13b5ea', |
| 40 |
], |
| 41 |
[ |
| 42 |
'name' => 'jobwp_search_btn_font_color', |
| 43 |
'type' => 'text', |
| 44 |
'default' => '#FFF', |
| 45 |
], |
| 46 |
[ |
| 47 |
'name' => 'jobwp_search_btn_font_size', |
| 48 |
'type' => 'number', |
| 49 |
'default' => '14', |
| 50 |
], |
| 51 |
[ |
| 52 |
'name' => 'jobwp_search_btn_bg_color_hvr', |
| 53 |
'type' => 'text', |
| 54 |
'default' => '#6fa0df', |
| 55 |
], |
| 56 |
[ |
| 57 |
'name' => 'jobwp_search_btn_font_color_hvr', |
| 58 |
'type' => 'text', |
| 59 |
'default' => '#FFF', |
| 60 |
], |
| 61 |
[ |
| 62 |
'name' => 'jobwp_search_container_bg_color', |
| 63 |
'type' => 'text', |
| 64 |
'default' => '#FFF', |
| 65 |
], |
| 66 |
[ |
| 67 |
'name' => 'jobwp_search_container_border_color', |
| 68 |
'type' => 'text', |
| 69 |
'default' => '#DDD', |
| 70 |
], |
| 71 |
[ |
| 72 |
'name' => 'jobwp_search_item_bg_color', |
| 73 |
'type' => 'text', |
| 74 |
'default' => '#FFF', |
| 75 |
], |
| 76 |
[ |
| 77 |
'name' => 'jobwp_search_item_border_color', |
| 78 |
'type' => 'text', |
| 79 |
'default' => '#DDD', |
| 80 |
], |
| 81 |
[ |
| 82 |
'name' => 'jobwp_search_item_font_size', |
| 83 |
'type' => 'number', |
| 84 |
'default' => '12', |
| 85 |
], |
| 86 |
]; |
| 87 |
} |
| 88 |
} |