| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* Trait: Listing Styles Settings |
| 8 |
*/ |
| 9 |
trait Jobwp_Listing_Styles_Settings |
| 10 |
{ |
| 11 |
protected $fields, $settings, $options; |
| 12 |
|
| 13 |
protected function jobwp_set_listing_styles_settings( $post ) { |
| 14 |
|
| 15 |
$this->fields = $this->jobwp_listing_styles_option_fileds(); |
| 16 |
|
| 17 |
$this->options = $this->jobwp_build_set_settings_options( $this->fields, $post ); |
| 18 |
|
| 19 |
$this->settings = apply_filters( 'jobwp_listing_styles', $this->options, $post ); |
| 20 |
|
| 21 |
return update_option( 'jobwp_listing_styles', $this->settings ); |
| 22 |
|
| 23 |
} |
| 24 |
|
| 25 |
function jobwp_get_listing_styles_settings() { |
| 26 |
|
| 27 |
$this->fields = $this->jobwp_listing_styles_option_fileds(); |
| 28 |
$this->settings = get_option('jobwp_listing_styles'); |
| 29 |
|
| 30 |
return $this->jobwp_build_get_settings_options( $this->fields, $this->settings ); |
| 31 |
} |
| 32 |
|
| 33 |
protected function jobwp_listing_styles_option_fileds() { |
| 34 |
|
| 35 |
return [ |
| 36 |
[ |
| 37 |
'name' => 'jobwp_listing_title_font_color', |
| 38 |
'type' => 'text', |
| 39 |
'default' => '#242424', |
| 40 |
], |
| 41 |
[ |
| 42 |
'name' => 'jobwp_listing_title_font_size', |
| 43 |
'type' => 'number', |
| 44 |
'default' => '20', |
| 45 |
], |
| 46 |
[ |
| 47 |
'name' => 'jobwp_listing_overview_font_color', |
| 48 |
'type' => 'text', |
| 49 |
'default' => '#555555', |
| 50 |
], |
| 51 |
[ |
| 52 |
'name' => 'jobwp_listing_overview_font_size', |
| 53 |
'type' => 'number', |
| 54 |
'default' => '14', |
| 55 |
], |
| 56 |
[ |
| 57 |
'name' => 'jobwp_listing_info_font_color', |
| 58 |
'type' => 'text', |
| 59 |
'default' => '#555555', |
| 60 |
], |
| 61 |
[ |
| 62 |
'name' => 'jobwp_listing_info_font_size', |
| 63 |
'type' => 'number', |
| 64 |
'default' => '16', |
| 65 |
], |
| 66 |
[ |
| 67 |
'name' => 'jobwp_listing_item_bg_color', |
| 68 |
'type' => 'text', |
| 69 |
'default' => '#FFF', |
| 70 |
], |
| 71 |
[ |
| 72 |
'name' => 'jobwp_listing_item_border_color', |
| 73 |
'type' => 'text', |
| 74 |
'default' => '#DDD', |
| 75 |
], |
| 76 |
[ |
| 77 |
'name' => 'jobwp_pagination_font_color', |
| 78 |
'type' => 'text', |
| 79 |
'default' => '#13b5ea', |
| 80 |
], |
| 81 |
[ |
| 82 |
'name' => 'jobwp_pagination_border_color', |
| 83 |
'type' => 'text', |
| 84 |
'default' => '#13b5ea', |
| 85 |
], |
| 86 |
[ |
| 87 |
'name' => 'jobwp_hover_bg_color', |
| 88 |
'type' => 'text', |
| 89 |
'default' => '#13b5ea', |
| 90 |
], |
| 91 |
[ |
| 92 |
'name' => 'jobwp_hover_font_color', |
| 93 |
'type' => 'text', |
| 94 |
'default' => '#FFF', |
| 95 |
], |
| 96 |
[ |
| 97 |
'name' => 'jobwp_pagination_bg_color', |
| 98 |
'type' => 'text', |
| 99 |
'default' => '#FFF', |
| 100 |
], |
| 101 |
[ |
| 102 |
'name' => 'jobwp_pagination_font_size', |
| 103 |
'type' => 'number', |
| 104 |
'default' => '14', |
| 105 |
], |
| 106 |
[ |
| 107 |
'name' => 'jobwp_pagination_border_radius', |
| 108 |
'type' => 'number', |
| 109 |
'default' => '0', |
| 110 |
], |
| 111 |
]; |
| 112 |
} |
| 113 |
} |