LLMS_Post_Model::set_terms( array $terms, string $tax, boolean $append = false )
Update terms for the post for a given taxonomy
Parameters Parameters
- $terms
-
(array) (Required) Array of terms (name or ids).
- $tax
-
(string) (Required) The name of the tax.
- $append
-
(boolean) (Optional) If true, will append the terms, false will replace existing terms. Default is
false.Default value: false
Return Return
(bool)
Source Source
File: includes/abstracts/abstract.llms.post.model.php
public function set_terms( $terms, $tax, $append = false ) {
$set = wp_set_object_terms( $this->get( 'id' ), $terms, $tax, $append );
// wp_set_object_terms has 3 options when unsuccessful and only 1 for success
// an array of terms when successful, let's keep it simple...
return is_array( $set );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.8.0 | Introduced. |