HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: /var/www/kevin-demo/wp-content/plugins/ajax-search-pro/src/server/Suggest/KeywordSuggest.php
<?php
namespace WPDRMS\ASP\Suggest;

defined('ABSPATH') or die("You can't access this file directly.");

class KeywordSuggest extends AbstractSuggest {

	private $suggest;
	private array $classes = array(
		'google'        => 'Google',
		'google_places' => 'GooglePlaces',
		'statistics'    => 'Statistics',
		'titles'        => 'PostTypeTitles',
		'tags'          => 'TaxonomyTerms',
		'terms'         => 'TaxonomyTerms',
	);

	public function __construct( string $source, $args ) {
		$args['taxonomy'] = $source === 'tags' ? 'post_tag' : $args['taxonomy'];
		$source           = $source === 'tags' ? 'terms' : $source;
		$class            = __NAMESPACE__ . '\\Suggest' . $this->classes[ $source ];
		$args             = apply_filters('asp/suggestions/args', $args, $source);
		$this->suggest    = new $class($args);
	}

	public function getKeywords( string $q ): array {
		return apply_filters('asp/suggestions/keywords', $this->suggest->getKeywords($q), $q);
	}
}