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
Return Return
(mixed) When single a single term object or null. When not single an array of term objects.
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(); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.8.0 | Introduced. |