| 1 |
<?php |
| 2 |
|
| 3 |
namespace FilterEverything\Filter; |
| 4 |
|
| 5 |
if ( ! defined('ABSPATH') ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
class DefaultSettings |
| 9 |
{ |
| 10 |
public function __construct() |
| 11 |
{ |
| 12 |
|
| 13 |
} |
| 14 |
|
| 15 |
public function wpc_filter_experimental() |
| 16 |
{ |
| 17 |
return array( |
| 18 |
'use_loader' => 'on', |
| 19 |
'use_wait_cursor' => 'on', |
| 20 |
'dark_overlay' => 'on', |
| 21 |
'auto_scroll' => '', |
| 22 |
'styled_inputs' => '', |
| 23 |
'select2_dropdowns' => '', |
| 24 |
); |
| 25 |
} |
| 26 |
public function wpc_filter_settings() |
| 27 |
{ |
| 28 |
$default_show_terms_in_content = []; |
| 29 |
$theme_dependencies = flrt_get_theme_dependencies(); |
| 30 |
|
| 31 |
if( flrt_is_woocommerce() ){ |
| 32 |
$default_show_terms_in_content = ['woocommerce_no_products_found', 'woocommerce_archive_description']; |
| 33 |
} |
| 34 |
|
| 35 |
if ( isset( $theme_dependencies['chips_hook'] ) && is_array( $theme_dependencies['chips_hook'] ) ) { |
| 36 |
foreach ( $theme_dependencies['chips_hook'] as $compat_chips_hook ) { |
| 37 |
$default_show_terms_in_content[] = $compat_chips_hook; |
| 38 |
} |
| 39 |
} |
| 40 |
|
| 41 |
$defaultOptions = array( |
| 42 |
'primary_color' => '#0570e2', |
| 43 |
'container_height' => '550', |
| 44 |
'show_open_close_button' => '', |
| 45 |
'show_terms_in_content' => $default_show_terms_in_content, |
| 46 |
'widget_debug_messages' => 'on' |
| 47 |
); |
| 48 |
|
| 49 |
// PRO default options |
| 50 |
if( defined('FLRT_FILTERS_PRO') && FLRT_FILTERS_PRO ){ |
| 51 |
$defaultOptions['mobile_filter_settings'] = 'show_bottom_widget'; |
| 52 |
} |
| 53 |
|
| 54 |
// Free default options (fresh installs only — activate() seeds this array |
| 55 |
// once and never touches an existing wpc_filter_settings). Filter pages are |
| 56 |
// noindex in free by design, so hiding the filter links from crawlers and |
| 57 |
// keeping crawlers off the filter URLs via robots.txt costs nothing in |
| 58 |
// search visibility and spares new sites the crawler-trap load out of the |
| 59 |
// box. Existing installs keep their behaviour until the options are |
| 60 |
// enabled — the 1.9.6 admin notice points them there. |
| 61 |
if( ! defined('FLRT_FILTERS_PRO') ){ |
| 62 |
$defaultOptions['disable_filter_links_for_bots'] = 'on'; |
| 63 |
$defaultOptions['robots_txt_block_filters'] = 'on'; |
| 64 |
} |
| 65 |
|
| 66 |
return $defaultOptions; |
| 67 |
} |
| 68 |
} |