| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* Trait: Listing Content Settings |
| 8 |
*/ |
| 9 |
trait Jobwp_Listing_Content_Settings |
| 10 |
{ |
| 11 |
protected $fields, $settings, $options; |
| 12 |
|
| 13 |
protected function jobwp_set_listing_content_settings( $post ) { |
| 14 |
|
| 15 |
$this->fields = $this->jobwp_listing_content_option_fileds(); |
| 16 |
|
| 17 |
$this->options = $this->jobwp_build_set_settings_options( $this->fields, $post ); |
| 18 |
|
| 19 |
$this->settings = apply_filters( 'jobwp_detail_settings', $this->options, $post ); |
| 20 |
|
| 21 |
return update_option( 'jobwp_detail_settings', serialize( $this->settings ) ); |
| 22 |
|
| 23 |
} |
| 24 |
|
| 25 |
function jobwp_get_listing_content_settings() { |
| 26 |
|
| 27 |
$this->fields = $this->jobwp_listing_content_option_fileds(); |
| 28 |
$this->settings = stripslashes_deep( unserialize( get_option('jobwp_detail_settings') ) ); |
| 29 |
|
| 30 |
return $this->jobwp_build_get_settings_options( $this->fields, $this->settings ); |
| 31 |
} |
| 32 |
|
| 33 |
protected function jobwp_listing_content_option_fileds() { |
| 34 |
|
| 35 |
return [ |
| 36 |
[ |
| 37 |
'name' => 'jobwp_list_display_overview', |
| 38 |
'type' => 'boolean', |
| 39 |
'default' => false, |
| 40 |
], |
| 41 |
[ |
| 42 |
'name' => 'jobwp_list_overview_length', |
| 43 |
'type' => 'number', |
| 44 |
'default' => 30, |
| 45 |
], |
| 46 |
[ |
| 47 |
'name' => 'jobwp_list_exp_lbl_txt', |
| 48 |
'type' => 'text', |
| 49 |
'default' => 'Experience', |
| 50 |
], |
| 51 |
[ |
| 52 |
'name' => 'jobwp_list_deadline_lbl_txt', |
| 53 |
'type' => 'text', |
| 54 |
'default' => 'Deadline', |
| 55 |
], |
| 56 |
]; |
| 57 |
} |
| 58 |
} |