query.get_term_by

/ Database / query.get_term_by

Get all Term data from database by Term field and data

Parameters supported : field, value, taxonomy, output, filter

It returns: Term Row (object or array) from database. Will return false if taxonomy does not exist or term was not found. Othewise returns object (by default) or array of fields depending on output parameter

Syntax:

[query.get_term_by field=” ” value=” ” taxonomy=” ” output=” ” filter=” ” /]

  • field: (string) (required) Either ‘id’, ‘slug’, ‘name’, or ‘term_taxonomy_id’ || Default: none
  • value: (string|integer) (required) Search for this term value || Default: None
  • taxonomy: (string) (required) Taxonomy Name category, post_tag, link_category, nav_menu or something custom || Default: ” (empty string)
  • output: (string) (optional) Constant OBJECT, ARRAY_A, or ARRAY_N || Default: OBJECT
  • filter: (string) (optional) default is raw or no WordPress defined filter will applied. || Default: ‘raw’

Example:

Categories
Most Popular

Leave a Reply

Your email address will not be published. Required fields are marked *