LLMS_Post_Model::get_terms( string $tax, boolean $single = false )

Get an array of terms for a given taxonomy for the post


Parameters Parameters

$tax

(string) (Required) Taxonomy name.

$single

(boolean) (Optional) Return only one term as an int, useful for taxes which Can only have one term (eg: visibilities and difficulties and such)

Default value: false


Top ↑

Return Return

(mixed) When single a single term object or null. When not single an array of term objects.


Top ↑

Source Source

File: includes/abstracts/abstract.llms.post.model.php

	public function get_terms( $tax, $single = false ) {

		$terms = get_the_terms( $this->get( 'id' ), $tax );

		if ( $single ) {
			return $terms ? $terms[0] : null;
		}

		return $terms ? $terms : array();

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.