HEX
Server: Apache
System: Linux 244.240.109.208.host.secureserver.net 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64
User: icsla (1002)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/icsla/public_html/wp-content/plugins/ajax-search-pro/includes/classes/Utils/Taxonomy.php
<?php
namespace WPDRMS\ASP\Utils;

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

class Taxonomy {
	/**
	 * Gets a list of taxonomy terms, separated by a comma (or as defined)
	 *
	 * @param $taxonomy
	 * @param int $count
	 * @param string $separator
	 * @param array $args arguments passed to get_terms() or wp_get_post_terms() functions
	 * @return string
	 */
	public static function getTermsList($taxonomy, int $count = 5, string $separator = ', ', array $args = array()): string {
		// Additional keys
		$args = array_merge($args, array(
			'taxonomy' => $taxonomy,
			'fields' => 'names',
			'number' => $count
		));
		$terms = wpd_get_terms($args);
		if ( !is_wp_error($terms) && !empty($terms) ) {
			return implode($separator, $terms);
		} else {
			return '';
		}
	}
}