PluginProbe
Property Hive / 1.4.46
Property Hive v1.4.46
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
propertyhive / includes / admin / settings / class-ph-settings-general.php

class-ph-settings-general.php in Property Hive 1.4.46, at includes/admin/settings/class-ph-settings-general.php

609 lines 25.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * PropertyHive General Settings
4 *
5 * @author PropertyHive
6 * @category Admin
7 * @package PropertyHive/Admin
8 * @version 1.0.0
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly
13 }
14
15 if ( ! class_exists( 'PH_Settings_General' ) ) :
16
17 /**
18 * PH_Settings_General
19 */
20 class PH_Settings_General extends PH_Settings_Page {
21
22 /**
23 * Constructor.
24 */
25 public function __construct() {
26 $this->id = 'general';
27 $this->label = __( 'General', 'propertyhive' );
28
29 add_filter( 'propertyhive_settings_tabs_array', array( $this, 'add_settings_page' ), 5 );
30 add_action( 'propertyhive_sections_' . $this->id, array( $this, 'output_sections' ) );
31 add_action( 'propertyhive_settings_' . $this->id, array( $this, 'output' ) );
32 add_action( 'propertyhive_settings_save_' . $this->id, array( $this, 'save' ) );
33 }
34
35 /**
36 * Get sections
37 *
38 * @return array
39 */
40 public function get_sections() {
41 $sections = array(
42 '' => __( 'General', 'propertyhive' ),
43 'modules' => __( 'Modules', 'propertyhive' ),
44 'international' => __( 'International', 'propertyhive' ),
45 'map' => __( 'Map', 'propertyhive' ),
46 'gdpr' => __( 'GDPR', 'propertyhive' ),
47 'misc' => __( 'Miscellaneous', 'propertyhive' ),
48 );
49
50 return $sections;
51 }
52
53
54 /**
55 * Get general settings array
56 *
57 * @return array
58 */
59 public function get_settings() {
60
61 $departments = ph_get_departments();
62
63 $settings = array(
64
65 array( 'title' => __( 'General Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ),
66
67 );
68
69 $i = 0;
70 foreach ( $departments as $key => $value )
71 {
72 $checkboxgroup = 'middle';
73 if ( $i == 0 ) { $checkboxgroup = 'start'; }
74 if ( $i == (count($departments) - 1) ) { $checkboxgroup = 'end'; }
75
76 $settings[] = array(
77 'title' => __( 'Active Departments', 'propertyhive' ),
78 'desc' => $value,
79 'id' => 'propertyhive_active_departments_' . str_replace("residential-", "", $key),
80 'type' => 'checkbox',
81 'default' => ( ( in_array($key, array('residential-sales', 'residential-lettings', 'commercial')) ) ? 'yes' : '' ),
82 'checkboxgroup' => $checkboxgroup,
83 );
84
85 ++$i;
86 }
87
88 $settings[] = array(
89 'title' => __( 'Primary Department', 'propertyhive' ),
90 'id' => 'propertyhive_primary_department',
91 'type' => 'radio',
92 'default' => 'residential-sales',
93 'options' => $departments,
94 );
95
96 $settings[] = array(
97 'title' => __( 'Property Search Results Page', 'propertyhive' ),
98 //'desc' => '<br/>' . sprintf( __( 'The base page can also be used in your <a href="%s">product permalinks</a>.', 'propertyhive' ), admin_url( 'options-permalink.php' ) ),
99 'id' => 'propertyhive_search_results_page_id',
100 'type' => 'single_select_page',
101 'default' => '',
102 'css' => 'min-width:300px;',
103 'desc' => __( 'This sets the page of your property search results', 'propertyhive' ),
104 );
105
106 $settings[] = array(
107 'title' => __( 'Lettings Fees (Residential)', 'propertyhive' ),
108 'id' => 'propertyhive_lettings_fees',
109 'type' => 'textarea',
110 'css' => 'height:150px; width:100%; max-width:400px'
111 );
112
113 $settings[] = array(
114 'title' => __( 'Lettings Fees (Commercial)', 'propertyhive' ),
115 'id' => 'propertyhive_lettings_fees_commercial',
116 'type' => 'textarea',
117 'css' => 'height:150px; width:100%; max-width:400px'
118 );
119
120 $settings[] = array(
121 'title' => __( 'Display Link To Lettings Fees Next To Price', 'propertyhive' ),
122 'desc' => __( 'In Search Results', 'propertyhive' ),
123 'id' => 'propertyhive_lettings_fees_display_search_results',
124 'type' => 'checkbox',
125 'checkboxgroup' => 'start',
126 );
127
128 $settings[] = array(
129 'title' => __( 'Display Link To Lettings Fees Next To Price', 'propertyhive' ),
130 'desc' => __( 'On Property Details Page', 'propertyhive' ),
131 'id' => 'propertyhive_lettings_fees_display_single_property',
132 'type' => 'checkbox',
133 'checkboxgroup' => 'end',
134 );
135
136 $settings[] = array( 'type' => 'sectionend', 'id' => 'general_options');
137
138 return apply_filters( 'propertyhive_general_settings', $settings );
139 }
140
141 /**
142 * Get general modules settings array
143 *
144 * @return array
145 */
146 public function get_general_modules_setting() {
147
148 return apply_filters( 'propertyhive_general_modules_settings', array(
149
150 array( 'title' => __( 'Disabled Modules', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'modules_options' ),
151
152 array(
153 'type' => 'html',
154 'html' => __( 'Here you can choose which modules are enabled or disabled within Property Hive. Check the modules you <strong>DO NOT</strong> wish to use from the list below', 'propertyhive' ) . ':',
155 ),
156
157 array(
158 'title' => __( 'Disabled Modules', 'propertyhive' ),
159 'desc' => __( 'Contacts (Applicants, Owners/Landlords and Third Party Contacts)', 'propertyhive' ),
160 'id' => 'propertyhive_module_disabled_contacts',
161 'type' => 'checkbox',
162 'default' => '',
163 'checkboxgroup' => 'start'
164 ),
165
166 array(
167 'title' => __( 'Disabled Modules', 'propertyhive' ),
168 'desc' => __( 'Appraisals', 'propertyhive' ),
169 'id' => 'propertyhive_module_disabled_appraisals',
170 'type' => 'checkbox',
171 'default' => '',
172 'checkboxgroup' => 'middle'
173 ),
174
175 array(
176 'title' => __( 'Disabled Modules', 'propertyhive' ),
177 'desc' => __( 'Viewings', 'propertyhive' ),
178 'id' => 'propertyhive_module_disabled_viewings',
179 'type' => 'checkbox',
180 'default' => '',
181 'checkboxgroup' => 'middle'
182 ),
183
184 array(
185 'title' => __( 'Disabled Modules', 'propertyhive' ),
186 'desc' => __( 'Offers and Sales', 'propertyhive' ),
187 'id' => 'propertyhive_module_disabled_offers_sales',
188 'type' => 'checkbox',
189 'default' => '',
190 'checkboxgroup' => 'middle'
191 ),
192
193 array(
194 'title' => __( 'Disabled Modules', 'propertyhive' ),
195 'desc' => __( 'Enquiries', 'propertyhive' ),
196 'id' => 'propertyhive_module_disabled_enquiries',
197 'type' => 'checkbox',
198 'default' => '',
199 'checkboxgroup' => 'end'
200 ),
201
202 array( 'type' => 'sectionend', 'id' => 'modules_options'),
203
204 ) ); // End general module settings
205 }
206
207 /**
208 * Get international settings array
209 *
210 * @return array
211 */
212 public function get_general_international_setting() {
213
214 $settings = array(
215
216 array( 'title' => __( 'International Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'international_options' ),
217
218 array(
219 'title' => __( 'Default Country', 'propertyhive' ),
220 'id' => 'propertyhive_default_country',
221 'type' => 'single_select_country',
222 'css' => 'min-width:300px;',
223 ),
224
225 array(
226 'title' => __( 'Countries Where You Operate', 'propertyhive' ),
227 'id' => 'propertyhive_countries',
228 'type' => 'multi_select_countries',
229 'css' => 'min-width:300px;',
230 'desc' => __( 'Hold ctrl/cmd whilst clicking to select multiple', 'propertyhive' )
231 ),
232
233 array(
234 'title' => __( 'Price Thousand Separator', 'propertyhive' ),
235 'id' => 'propertyhive_price_thousand_separator',
236 'type' => 'text',
237 'default' => ',',
238 'css' => 'width:50px;',
239 ),
240
241 array(
242 'title' => __( 'Price Decimal Separator', 'propertyhive' ),
243 'id' => 'propertyhive_price_decimal_separator',
244 'type' => 'text',
245 'default' => '.',
246 'css' => 'width:50px;',
247 )
248 );
249
250 $ph_countries = new PH_Countries();
251 $ph_countries = $ph_countries->countries;
252
253 $currencies = array();
254 $countries = array();
255 if ( !empty($ph_countries) )
256 {
257 foreach ( $ph_countries as $country_code => $country )
258 {
259 $currencies[$country['currency_code']] = $country['currency_code'];
260 $countries[$country_code] = $country;
261 }
262 }
263 $currencies = array_unique($currencies);
264 ksort($currencies);
265
266 $settings[] = array(
267 'title' => __( 'Currency Used In Search Forms', 'propertyhive' ),
268 'id' => 'propertyhive_search_form_currency',
269 'type' => 'select',
270 'options' => $currencies,
271 'default' => 'GBP',
272 'desc' => __( 'Please note that this doesn\'t change the currency symbol shown in price dropdowns within search forms. The easiest way to achieve that is to use our free <a href="https://wp-property-hive.com/addons/template-assistant/" target="_blank">Template Assistant add on</a>.', 'propertyhive' ),
273 );
274
275 $settings[] = array( 'type' => 'sectionend', 'id' => 'international_options');
276
277 $settings[] = array(
278 'type' => 'html',
279 'html' => '<script>
280
281 var countries = '. json_encode( $countries ) . ';
282
283 </script>'
284 );
285
286 return apply_filters( 'propertyhive_general_international_settings', $settings );
287 }
288
289 /**
290 * Get map settings array
291 *
292 * @return array
293 */
294 public function get_general_map_setting() {
295
296 return apply_filters( 'propertyhive_general_map_settings', array(
297
298 array( 'title' => __( 'Map Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'map_options' ),
299
300 array(
301 'title' => __( 'Google Maps API Key', 'propertyhive' ),
302 'id' => 'propertyhive_google_maps_api_key',
303 'type' => 'text',
304 'desc' => '<p>' . __( 'If you have a Google Maps API key you can enter it here. You can generate an API key <a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="_blank">here</a>.<br>This is used when displaying the map when adding/editing properties, and if using our <a href="https://wp-property-hive.com/addons/map-search/" target="_blank">Map Search</a> or <a href="https://wp-property-hive.com/addons/radial-search/" target="_blank">Radial Search</a> add ons.<br>When creating your API key we recommend that you enable the Geocoding library. More about this can be found <a href="https://docs.wp-property-hive.com/user-guide/maps-co-ordinates-and-geocoding/" target="_blank">here</a>.', 'propertyhive' ) . '</p>'
305 ),
306
307 array( 'type' => 'sectionend', 'id' => 'map_options'),
308
309 ) ); // End general map settings
310 }
311
312 /**
313 * Get GDPR settings array
314 *
315 * @return array
316 */
317 public function get_general_gdpr_setting() {
318
319 return apply_filters( 'propertyhive_general_gdpr_settings', array(
320
321 array( 'title' => __( 'GDPR Settings', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'gdpr_options' ),
322
323 array(
324 'title' => __( 'Store Property Enquiries', 'propertyhive' ),
325 'id' => 'propertyhive_store_property_enquiries',
326 'type' => 'checkbox',
327 'default' => 'yes',
328 'desc' => __( 'If using the default property enquiry form that comes with Property Hive, select this option if enquiries should be saved in the \'Enquiries\' section of Property Hive. Note that regardless of whether this is ticked or not, the enquiry will still be sent via email. This option simply determines whether we save it to the database or not.', 'propertyhive' )
329 ),
330
331 array(
332 'title' => __( 'Property Enquiry Form Disclaimer', 'propertyhive' ),
333 'id' => 'propertyhive_property_enquiry_form_disclaimer',
334 'type' => 'wysiwyg',
335 'desc' => __( 'Add disclaimer text, including a link to a privacy policy, that will appear on the property enquiry form.', 'propertyhive' )
336 ),
337
338 array(
339 'title' => __( 'Applicant Registration Form Disclaimer', 'propertyhive' ),
340 'id' => 'propertyhive_applicant_registration_form_disclaimer',
341 'type' => 'wysiwyg',
342 'desc' => __( 'Add disclaimer text, including a link to a privacy policy, that will appear on the applicant registration form.', 'propertyhive' )
343 ),
344
345 array( 'type' => 'sectionend', 'id' => 'gdpr_options'),
346
347 ) ); // End general GDPR settings
348 }
349
350 /**
351 * Get misc settings array
352 *
353 * @return array
354 */
355 public function get_general_misc_setting() {
356
357 return apply_filters( 'propertyhive_general_misc_settings', array(
358
359 array( 'title' => __( 'Property Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'property_options' ),
360
361 array(
362 'title' => __( 'Search By Address Should', 'propertyhive' ),
363 'id' => 'propertyhive_address_keyword_compare',
364 'type' => 'radio',
365 'default' => '=',
366 'options' => array(
367 '=' => __( 'Match Keyword Exactly', 'propertyhive' ),
368 'LIKE' => __( 'Perform Loose Search', 'propertyhive' ),
369 ),
370 'desc_tip' => __( 'Applicable if you allow users to search by entering a location. If \'Match Keyword Exactly\' is selected a search for \'Walton\' would not return properties in \'Walton On Thames\', but would prevent properties in \'Lincolnshire\' appearing when searching for \'Lincoln\'. \'Perform Loose Search\' would do the opposite.', 'propertyhive' )
371 ),
372
373 array(
374 'title' => __( 'When Entering Features', 'propertyhive' ),
375 'id' => 'propertyhive_features_type',
376 'type' => 'radio',
377 'options' => array(
378 '' => __( 'Allow Features To Be Freetyped', 'propertyhive' ),
379 'checkbox' => __( 'Select From A Predefined List (Editable from \'Custom Fields\')', 'propertyhive' ),
380 ),
381 'desc' => __( '', 'propertyhive' )
382 ),
383
384 array( 'type' => 'sectionend', 'id' => 'property_options'),
385
386 array( 'title' => __( 'Applicant Options', 'propertyhive' ), 'type' => 'title', 'desc' => '', 'id' => 'applicant_registration_options' ),
387
388 array(
389 'title' => __( 'Allow Applicants To Login and Manage Account', 'propertyhive' ),
390 'id' => 'propertyhive_applicant_users',
391 'type' => 'checkbox',
392 'desc' => __( 'Applicable when you allow users to register on a form using the [applicant_registration_form] shortcode.<br><br>Selecting this will allow applicants to create a password when registering, then login to manage their details and requirements. They will be created as a WordPress user with \'Property Hive Contact\' role.<br><br>If unticked applicants will still be able to register and they\'ll go into Property Hive as an applicant, they just won\'t be able to login at a later date.', 'propertyhive' )
393 ),
394
395 array(
396 'title' => __( 'Send Email When Applicant Registers', 'propertyhive' ),
397 'id' => 'propertyhive_new_registration_alert',
398 'type' => 'checkbox',
399 'desc' => __( 'Choose whether an email should be sent alerting you to the fact someone has registered. The email will be sent to the chosen office. Offices can be managed click selecting the \'Offices\' tab above.', 'propertyhive' )
400 ),
401
402 array(
403 'title' => __( 'My Account Page', 'propertyhive' ),
404 'id' => 'propertyhive_my_account_page_id',
405 'type' => 'single_select_page',
406 'default' => '',
407 'css' => 'min-width:300px;',
408 'desc' => __( 'This sets the \'My Account\' page. This page should contain the [propertyhive_my_account] shortcode', 'propertyhive' ),
409 ),
410
411 array(
412 'title' => __( 'Match Price Range % (Lower)', 'propertyhive' ),
413 'id' => 'propertyhive_applicant_match_price_range_percentage_lower',
414 'type' => 'number',
415 'default' => '20',
416 'desc' => '<p>' . __( 'When a maximum price is entered against an applicants requirements we create a \'Match Price Range\' which determines the price of properties that would get matched to the applicant.<br>We do this because you:<br>a) Wouldn\'t want to send them properties that were way below their specified maximum price and<br>b) Would probably want to send them properties which are slightly just over the price specified as, if the perfect property came along, a lot of people would actually be able to increase their maximum.<br>These settings determine the % above and below the maximum price entered that the \'Match Price Range\' will default to per applicant.<br>For example, if the maximum price entered was &pound;500,000, the lower setting was 20% and the higher setting was 5%, the applicant would actually match to properties that were priced &pound;400,000 - &pound;525,000.<br>This price range can be overwritten on a per-applicant basis, or disabled completely by leaving these settings empty.<br>Note that this currently only applies to applicants looking for sales properties and changing this value at a later date will only effect applicants that don\'t already have a match price range set.', 'propertyhive' ) . '</p>',
417 ),
418
419 array(
420 'title' => __( 'Match Price Range % (Higher)', 'propertyhive' ),
421 'id' => 'propertyhive_applicant_match_price_range_percentage_higher',
422 'type' => 'number',
423 'default' => '5',
424 ),
425
426 array( 'type' => 'sectionend', 'id' => 'applicant_registration_options'),
427
428 array( 'title' => __( 'Property Media Storage', 'propertyhive' ), 'type' => 'title', 'desc' => 'By default media atttached to properties will be stored in the WordPress media library. If the property media is hosted elsewhere (for example if you import properties from a third party and they allow you to link direct to the files on their server) you can choose to store media as URL\'s. It also means that the images are not downloaded onto your server, thus saving diskspace.<br><br>Note: If you change this you\'ll need to re-add all of the property media for existing properties.<br>Note: Changing this will not delete all existing media or URLs entered.<br>Note: Choosing to store the media as URLs will mean you don\'t benefit from having access to different sized images (i.e. small , medium, large etc).', 'id' => 'media_storage_options' ),
429
430 array(
431 'title' => __( 'Images Stored As', 'propertyhive' ),
432 'id' => 'propertyhive_images_stored_as',
433 'type' => 'select',
434 'default' => 'files',
435 'options' => array(
436 'files' => __( 'Media Files', 'propertyhive' ),
437 'urls' => __( 'URLs', 'propertyhive' ),
438 ),
439 'desc' => __( '', 'propertyhive' )
440 ),
441
442 array(
443 'title' => __( 'Floorplans Stored As', 'propertyhive' ),
444 'id' => 'propertyhive_floorplans_stored_as',
445 'type' => 'select',
446 'default' => 'files',
447 'options' => array(
448 'files' => __( 'Media Files', 'propertyhive' ),
449 'urls' => __( 'URLs', 'propertyhive' ),
450 ),
451 'desc' => __( '', 'propertyhive' )
452 ),
453
454 array(
455 'title' => __( 'Brochures Stored As', 'propertyhive' ),
456 'id' => 'propertyhive_brochures_stored_as',
457 'type' => 'select',
458 'default' => 'files',
459 'options' => array(
460 'files' => __( 'Media Files', 'propertyhive' ),
461 'urls' => __( 'URLs', 'propertyhive' ),
462 ),
463 'desc' => __( '', 'propertyhive' )
464 ),
465
466 array(
467 'title' => __( 'EPCs Stored As', 'propertyhive' ),
468 'id' => 'propertyhive_epcs_stored_as',
469 'type' => 'select',
470 'default' => 'files',
471 'options' => array(
472 'files' => __( 'Media Files', 'propertyhive' ),
473 'urls' => __( 'URLs', 'propertyhive' ),
474 ),
475 'desc' => __( '', 'propertyhive' )
476 ),
477
478 array( 'type' => 'sectionend', 'id' => 'media_storage_options'),
479
480 ) ); // End general misc settings
481 }
482
483 /**
484 * Output the settings
485 */
486 public function output() {
487 global $current_section;
488
489 if ( $current_section )
490 {
491 switch ($current_section)
492 {
493 case "modules": { $settings = $this->get_general_modules_setting(); break; }
494 case "international": { $settings = $this->get_general_international_setting(); break; }
495 case "map": { $settings = $this->get_general_map_setting(); break; }
496 case "gdpr": { $settings = $this->get_general_gdpr_setting(); break; }
497 case "misc": { $settings = $this->get_general_misc_setting(); break; }
498 default: { die("Unknown setting section"); }
499 }
500 }
501 else
502 {
503 $settings = $this->get_settings();
504 }
505
506 PH_Admin_Settings::output_fields( $settings );
507 }
508
509 /**
510 * Output a colour picker input box.
511 *
512 * @access public
513 * @param mixed $name
514 * @param mixed $id
515 * @param mixed $value
516 * @param string $desc (default: '')
517 * @return void
518 */
519 function color_picker( $name, $id, $value, $desc = '' ) {
520 echo '<div class="color_box"><strong><img class="help_tip" data-tip="' . esc_attr( $desc ) . '" src="' . PH()->plugin_url() . '/assets/images/help.png" height="16" width="16" /> ' . esc_html( $name ) . '</strong>
521 <input name="' . esc_attr( $id ). '" id="' . esc_attr( $id ) . '" type="text" value="' . esc_attr( $value ) . '" class="colorpick" /> <div id="colorPickerDiv_' . esc_attr( $id ) . '" class="colorpickdiv"></div>
522 </div>';
523 }
524
525 /**
526 * Save settings
527 */
528 public function save() {
529 global $current_section;
530
531 if ( $current_section != '' )
532 {
533 switch ($current_section)
534 {
535 case 'modules':
536 {
537 $settings = $this->get_general_modules_setting();
538
539 PH_Admin_Settings::save_fields( $settings );
540 break;
541 }
542 case 'international':
543 {
544 if (!isset($_POST['propertyhive_countries']) || (isset($_POST['propertyhive_countries']) && empty($_POST['propertyhive_countries'])))
545 {
546 // If we haven't selected which countries we operate in
547 update_option( 'propertyhive_countries', array( ph_clean($_POST['propertyhive_default_country']) ) );
548 }
549 else
550 {
551 // We have default country and countries set
552 // Make sure default country is in list of countries selected
553 if ( !in_array(ph_clean($_POST['propertyhive_default_country']), ph_clean($_POST['propertyhive_countries'])) ) {
554 $_POST['propertyhive_default_country'] = $_POST['propertyhive_countries'][0];
555 }
556
557 update_option( 'propertyhive_default_country', ph_clean($_POST['propertyhive_default_country']) );
558 update_option( 'propertyhive_countries', ph_clean($_POST['propertyhive_countries']) );
559 }
560
561 update_option( 'propertyhive_price_thousand_separator', ph_clean($_POST['propertyhive_price_thousand_separator']) );
562 update_option( 'propertyhive_price_decimal_separator', ph_clean($_POST['propertyhive_price_decimal_separator']) );
563
564 update_option( 'propertyhive_search_form_currency', ph_clean($_POST['propertyhive_search_form_currency']) );
565
566 do_action( 'propertyhive_update_currency_exchange_rates' );
567
568 break;
569 }
570 case 'map':
571 {
572 $settings = $this->get_general_map_setting();
573
574 PH_Admin_Settings::save_fields( $settings );
575 break;
576 }
577 case 'gdpr':
578 {
579 $settings = $this->get_general_gdpr_setting();
580
581 PH_Admin_Settings::save_fields( $settings );
582 break;
583 }
584 case 'misc':
585 {
586 $settings = $this->get_general_misc_setting();
587
588 PH_Admin_Settings::save_fields( $settings );
589 break;
590 }
591 default: { die("Unknown setting section"); }
592 }
593 }
594 else
595 {
596 $settings = $this->get_settings();
597
598 PH_Admin_Settings::save_fields( $settings );
599
600 flush_rewrite_rules();
601 }
602 }
603
604 }
605
606 endif;
607
608 return new PH_Settings_General();
609