LLMS_Post_Model::set_terms( array $terms, string $tax, boolean $append = false )

Update terms for the post for a given taxonomy


Description Description


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 value: false


Top ↑

Return Return

(bool)


Top ↑

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 );
	}

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.





Permalink: