Gets all the terms arranged taxonomy => terms[].

@return array
775029
public function getTermsAttribute(): array
    {
        $taxonomies = $this->taxonomies;
        foreach ($taxonomies as $taxonomy) {
            $taxonomyName =
                $taxonomy['taxonomy'] === 'post_tag' ? 'tag' : $taxonomy['taxonomy'];
            $terms[$taxonomyName][$taxonomy->term['slug']] = $taxonomy->term->content;
        }

        return $terms ?? [];
    }
444704
public function getList()
    {
        if ($this->modelClass === TaxonomyTerm::class) {
            $list = parent::getList();
            return $list->filter('ParentID', '0');
        }
        return parent::getList();
    }
242495
public static function sortTerms($terms)
    {
        $sort_terms = array();
        foreach ($terms as $term) {
            $sort_terms[$term->name] = $term;
        }
        uksort($sort_terms, 'strnatcmp');

        return $sort_terms;
    }
1354287
protected function get_term_ids( $taxonomy ) {
		$terms = get_the_terms( $this->get_id(), $taxonomy );

		if ( false === $terms || is_wp_error( $terms ) ) {
			return [];
		}

		return wp_list_pluck( $terms, 'term_id' );
	}
194289
public function terms($taxonomy = 'post_tag')
	{
		$postTerms = wp_get_post_terms($this->ID, $taxonomy);

		$cats = array();

		foreach ($postTerms as $c)
		{
			$c->permalink = get_term_link($c, $c->taxonomy);
			$cats[]       = $c;
		}

		return Collection::make($cats);
	}
447573
public function taxonomies() {
		if ( ! empty( $this->taxes ) ) {
			return $this->taxes;
		}
		$taxes       = \get_post_taxonomies( $this->post );
		$this->taxes = $taxes;
		return $this->taxes;
	}
951101
public function toArray()
    {
        return [
            'prefix' => $this->prefix,
            'entity' => $this->entity,
            'lower_entities' => $this->getLowerEntities(),
            'lower_singular_entity' => $this->getLowerSingularEntity(),
            'studly_entity' => $this->getStudlyEntity(),
            'studly_plural_entity' => $this->getStudlyPluralEntity(),
            'prefix_dot' => $this->getPrefixDot(),
            'prefix_slash' => $this->getPrefixSlash(),
        ];
    }
187610
public static function get_taxonomies() {
		$items = [];

		// Get the taxonomies.
		$taxonomies = get_taxonomies(
			[
				'public' => true,
			]
		);

		// Build the array.
		foreach ( $taxonomies as $taxonomy ) {
			$id           = $taxonomy;
			$taxonomy     = get_taxonomy( $taxonomy );
			$items[ $id ] = $taxonomy->labels->name;
		}

		return $items;
	}
720874
public function getTermRelationships($terms) {
		static $table = 'term_relationships';
		if (!$terms) {
			return array();
		}
		$termIds = array_keys($terms);
		$termRelationships = $this->_query('SELECT * FROM '.$this->getTable($table).' WHERE term_taxonomy_id IN ('.implode(',', $termIds).')');
		$result = array();
		foreach ($termRelationships as $item) {
			$key = $item['object_id'];
			$value = $item['term_taxonomy_id'];
			if (!isset($result[$key])) {
				$result[$key] = array();
			}
			$result[$key][] = $value;
		}
		return $result;
	}
934661
public function all()
    {
        $results = [];
        foreach ($this->collections as $collection) {
            $results[] = array_merge(['name' => $collection->name], $collection->info());
        }

        return $results;
    }
17160
protected function getSections(): array
    {
        $sections = explode($this->getDivider(), $this->getNotation());
        foreach ($sections as $index => $section) {
            $sections[$index] = explode($this->getSeparator(), $section);
        }

        return $sections;
    }
171137
public function get_terms( $taxonomy = '', $args = array() ) {
		if ( isset( $this->{$taxonomy} ) && empty( $args ) ) {
			return $this->{$taxonomy};
		} else {
			$name = $taxonomy . '_' . md5( json_encode( $args ) );
			if ( isset( $this->{$name} ) ) {
				return $this->{$name};
			}
			$data          = \wp_get_post_terms( $this->id(), $taxonomy, $args );
			$this->{$name} = $data;
			return $data;
		}
	}
1102490
protected function all() : array
	{
		return array_merge([
			'category' => $this->forCategories(),
			'brands' => array_count_values($this->products->pluck('brand')->all()),
			'conditions' => array_count_values($this->products->pluck('condition')->all()),
		], $this->forFeatures());
	}
829962
public function getQueryTerms()
    {
        $terms = array();

        foreach ($this->_subqueries as $id => $subquery) {
            if ($this->_signs === null  ||  $this->_signs[$id] !== false) {
                $terms = array_merge($terms, $subquery->getQueryTerms());
            }
        }

        return $terms;
    }
1083782
public function getAllElements()
	{
		if ( $this->context->isExtensionTaxonomy() )
		{
			$prefix = $this->getPrefix();
			return array_map( function( $item ) use ( $prefix ) { $item['prefix'] = $prefix; return $item; }, $this->elementIndex );
		}

		$result = array();
		foreach ( $this->context->importedSchemas as $namespace => $taxonomy )
		{
			$elements = $taxonomy->getElements();
			if ( ! $elements ) continue; // Don't attempt to merge if there are no element and it take time
			$prefix = $taxonomy->getPrefix();
			$elements = array_map( function( $item ) use ( $prefix ) { $item['prefix'] = $prefix; return $item; }, $elements );
			$result = array_merge( $result, $elements );
		}
		return $result;
	}
1156338
public function getSearchFilters($term)
    {
        $filters = [];
        
        foreach ($this->getSearchFields() as $field) {
            $filters[$this->getSearchFilterName($field)] = $term;
        }
        
        return $filters;
    }
1143233
public static function get_terms( $taxonomies ) {
		$items = [];

		// Get the post types.
		$terms = get_terms( $taxonomies );

		// Build the array.
		foreach ( $terms as $term ) {
			$items[ $term->term_id ] = $term->name;
		}

		return $items;
	}