| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* Trait: Single Styles Settings |
| 8 |
*/ |
| 9 |
trait JobwpGeneralSettings |
| 10 |
{ |
| 11 |
protected $fields, $settings, $options; |
| 12 |
|
| 13 |
protected function jobwp_set_general_settings( $post ) { |
| 14 |
|
| 15 |
$this->fields = $this->jobwp_general_settings_option_fileds(); |
| 16 |
|
| 17 |
$this->options = $this->jobwp_build_set_settings_options( $this->fields, $post ); |
| 18 |
|
| 19 |
$this->settings = apply_filters( 'jobwp_general_settings', $this->options, $post ); |
| 20 |
|
| 21 |
return update_option( 'jobwp_general_settings', $this->settings ); |
| 22 |
|
| 23 |
} |
| 24 |
|
| 25 |
function jobwp_get_general_settings() { |
| 26 |
|
| 27 |
$this->fields = $this->jobwp_general_settings_option_fileds(); |
| 28 |
$this->settings = get_option('jobwp_general_settings'); |
| 29 |
|
| 30 |
return $this->jobwp_build_get_settings_options( $this->fields, $this->settings ); |
| 31 |
} |
| 32 |
|
| 33 |
protected function jobwp_general_settings_option_fileds() { |
| 34 |
|
| 35 |
return [ |
| 36 |
[ |
| 37 |
'name' => 'jobwp_admin_noti_email', |
| 38 |
'type' => 'email', |
| 39 |
'default' => '', |
| 40 |
], |
| 41 |
[ |
| 42 |
'name' => 'jobwp_list_layout', |
| 43 |
'type' => 'string', |
| 44 |
'default' => 'list', |
| 45 |
], |
| 46 |
[ |
| 47 |
'name' => 'jobwp_ext_application_form', |
| 48 |
'type' => 'boolean', |
| 49 |
'default' => false, |
| 50 |
], |
| 51 |
[ |
| 52 |
'name' => 'jobwp_ext_application_form_shortcode', |
| 53 |
'type' => 'text', |
| 54 |
'default' => '', |
| 55 |
], |
| 56 |
[ |
| 57 |
'name' => 'jobwp_ext_apply_now_url', |
| 58 |
'type' => 'boolean', |
| 59 |
'default' => false, |
| 60 |
], |
| 61 |
[ |
| 62 |
'name' => 'jobwp_admin_noti_email_users', |
| 63 |
'type' => 'text', |
| 64 |
'default' => '', |
| 65 |
], |
| 66 |
[ |
| 67 |
'name' => 'jobwp_hide_jobs_deadline_over', |
| 68 |
'type' => 'boolean', |
| 69 |
'default' => false, |
| 70 |
], |
| 71 |
[ |
| 72 |
'name' => 'jobwp_recaptcha_site_key', |
| 73 |
'type' => 'text', |
| 74 |
'default' => '', |
| 75 |
], |
| 76 |
[ |
| 77 |
'name' => 'jobwp_recaptcha_secret_key', |
| 78 |
'type' => 'text', |
| 79 |
'default' => '', |
| 80 |
], |
| 81 |
[ |
| 82 |
'name' => 'jobwp_captcha_on_apply_form', |
| 83 |
'type' => 'boolean', |
| 84 |
'default' => false, |
| 85 |
], |
| 86 |
[ |
| 87 |
'name' => 'jobwp_allow_login_apply', |
| 88 |
'type' => 'boolean', |
| 89 |
'default' => false, |
| 90 |
], |
| 91 |
]; |
| 92 |
} |
| 93 |
} |