query.set_post_terms

/ Database / query.set_post_terms

Title : query.set_post_terms
Purpose : Create Term and Taxonomy Relationships.
Syntax : [query.set_post_terms /]
Input Parameters : post_id: Post ID.
taxonomy: Taxonomy Slug.
append: If false will delete difference of terms.
terms: comma-separated or array of terms.
slugs: comma-separated or array of the slugs.
Return Value : It does not return anything
Example 1 :
Code : [query.set_post_terms post_id=”123″ taxonomy=”mytaxonomy” append=”true” terms=’term1,term2,term3′ /]
Output : Set posts terms
Description : Relates an object (post, link etc) to a term and taxonomy type. Creates the term and taxonomy relationship if it doesn’t already exist. Creates a term if it doesn’t exist (using the slug).

A relationship means that the term is grouped in or belongs to the taxonomy. A term has no meaning until it is given context by defining which taxonomy it exists under.

Categories
Most Popular

Leave a Reply

Your email address will not be published.