} } } } } if ( $value === '' && !empty($default) ) { $value = $default; } $value = apply_filters( 'dgwt/wcas/settings/load_value', $value, $option_key ); $value = apply_filters( 'dgwt/wcas/settings/load_value/key=' . $option_key, $value ); return $value; } /** * Update option * * @param string $optionKey * @param string $value * * @return bool */ public function updateOpt( $optionKey, $value = '' ) { $updated = false; if ( is_string( $optionKey ) && !empty($optionKey) ) { $settings = get_option( $this->settingSlug ); $value = apply_filters( 'dgwt/wcas/settings/update_value', $value, $optionKey ); $value = apply_filters( 'dgwt/wcas/settings/update_value/key=' . $optionKey, $value ); $canUpdate = false; if ( array_key_exists( $optionKey, $this->defaults ) ) { $settings[$optionKey] = $value; $canUpdate = true; } if ( $canUpdate ) { $updated = update_option( $this->settingSlug, $settings ); if ( $updated ) { $this->settingsCache = array(); do_action( 'dgwt/wcas/settings/option_updated', $optionKey, $value ); } } } return $updated; } /** * Handles output of the settings */ public static function output() { $settings = DGWT_WCAS()->settings->settingsApi; include_once DGWT_WCAS_DIR . 'partials/admin/settings.php'; } /** * Restore default option value * * @param mixed $value * @param mixed $default * @param array $option * * @return mixed */ public function restoreDefaultValueForFreePlan( $value, $default, $option ) { if ( !dgoraAsfwFs()->is_premium() ) { if ( self::isOptionPremium( $option ) ) { $value = $default; } } return $value; } /** * Check if user can see advanced settings * * @return bool */ public function canSeeAdvSettings() { $canSee = false; if ( is_bool( $this->canSeeAdvSettings ) ) { $canSee = $this->canSeeAdvSettings; } else { $settings = get_option( 'dgwt_wcas_settings_show_advanced' ); if ( !empty($settings) ) { if ( $settings === 'on' ) { $canSee = true; } elseif ( $settings === 'off' ) { $canSee = false; } $this->canSeeAdvSettings = $canSee; } } return $canSee; } /** * Toggle visibility of advanced settings * Ajax endpoint * * @return void */ public function toggleAdvancedSettings() { if ( !current_user_can( 'administrator' ) ) { wp_die( -1, 403 ); } check_ajax_referer( 'dgwt_wcas_advanced_options_switch' ); $show = ( !empty($_GET['adv_settings_value']) && $_GET['adv_settings_value'] === 'show' ? 'on' : 'off' ); update_option( 'dgwt_wcas_settings_show_advanced', $show ); wp_send_json_success(); } /** * Check if a option is premium * * @param array $option * * @return bool */ public static function isOptionPremium( $option ) { $is_premium = false; if ( !empty($option['class']) && strpos( $option['class'], 'dgwt-wcas-premium-only' ) !== false ) { $is_premium = true; } return $is_premium; } /** * Force values of some settings if they depend on other settings * * @return void */ private function dependentOptions() { add_filter( 'dgwt/wcas/settings/section=form', function ( $settings ) { $text = __( "You have selected the Appearance -> Style -> Pirx option. Pirx style forces a submit button to be enabled. You can find this option a few rows below. That's why this option is blocked.", 'ajax-search-for-woocommerce' ); $settings[400]['label'] = Helpers::createOverrideTooltip( 'ovtt-pirx-submit-button', '

' . $text . '

' ) . $settings[400]['label']; return $settings; } ); // Pirx style - force options for submit button // Mark that the value of the option "mobile overlay" is forced if ( $this->getOption( 'search_style' ) === 'pirx' ) { //Submit button add_filter( 'dgwt/wcas/settings/load_value/key=show_submit_button', function () { return 'on'; } ); add_filter( 'dgwt/wcas/settings/section=form', function ( $settings ) { $settings[400]['disabled'] = true; return $settings; } ); // Value of submit button add_filter( 'dgwt/wcas/settings/load_value/key=search_submit_text', function () { return ''; } ); add_filter( 'dgwt/wcas/settings/section=form', function ( $settings ) { $settings[500]['disabled'] = true; $settings[500]['class'] = $settings[500]['class'] . ' dgwt-wcas-hidden'; return $settings; } ); // Submit background color add_filter( 'dgwt/wcas/settings/load_value/key=bg_submit_color', function () { return ''; } ); add_filter( 'dgwt/wcas/settings/section=form', function ( $settings ) { $settings[510]['disabled'] = true; $settings[510]['class'] = $settings[510]['class'] . ' dgwt-wcas-hidden'; return $settings; } ); } } /** * Clear settings cache */ public function clearCache() { $this->settingsCache = array(); } }
Fatal error: Uncaught Error: Class 'DgoraWcas\Settings' not found in /home/arasetne/public_html/wp-content/plugins/ajax-search-for-woocommerce/ajax-search-for-woocommerce.php:72 Stack trace: #0 /home/arasetne/public_html/wp-content/plugins/ajax-search-for-woocommerce/ajax-search-for-woocommerce.php(379): DGWT_WC_Ajax_Search::getInstance() #1 /home/arasetne/public_html/wp-includes/class-wp-hook.php(324): DGWT_WCAS('') #2 /home/arasetne/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /home/arasetne/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /home/arasetne/public_html/wp-settings.php(550): do_action('plugins_loaded') #5 /home/arasetne/public_html/wp-config.php(188): require_once('/home/arasetne/...') #6 /home/arasetne/public_html/wp-load.php(50): require_once('/home/arasetne/...') #7 /home/arasetne/public_html/wp-blog-header.php(13): require_once('/home/arasetne/...') #8 /home/arasetne/public_html/index.php(17): require('/home/arasetne/...') #9 {main} thrown in /home/arasetne/public_html/wp-content/plugins/ajax-search-for-woocommerce/ajax-search-for-woocommerce.php on line 72