Clase principal utilizada para implementar el objeto WP_Term.

Fuente

Expediente: wp-includes / class-wp-term.php

finalclassWP_Term/**
	 * Term ID.
	 *
	 * @since 4.4.0
	 * @var int
	 */public$term_id;/**
	 * The term's name.
	 *
	 * @since 4.4.0
	 * @var string
	 */public$name='';/**
	 * The term's slug.
	 *
	 * @since 4.4.0
	 * @var string
	 */public$slug='';/**
	 * The term's term_group.
	 *
	 * @since 4.4.0
	 * @var int
	 */public$term_group='';/**
	 * Term Taxonomy ID.
	 *
	 * @since 4.4.0
	 * @var int
	 */public$term_taxonomy_id=0;/**
	 * The term's taxonomy name.
	 *
	 * @since 4.4.0
	 * @var string
	 */public$taxonomy='';/**
	 * The term's description.
	 *
	 * @since 4.4.0
	 * @var string
	 */public$description='';/**
	 * ID of a term's parent term.
	 *
	 * @since 4.4.0
	 * @var int
	 */public$parent=0;/**
	 * Cached object count for this term.
	 *
	 * @since 4.4.0
	 * @var int
	 */public$count=0;/**
	 * Stores the term object's sanitization level.
	 *
	 * Does not correspond to a database field.
	 *
	 * @since 4.4.0
	 * @var string
	 */public$filter='raw';/**
	 * Retrieve WP_Term instance.
	 *
	 * @since 4.4.0
	 *
	 * @global wpdb $wpdb WordPress database abstraction object.
	 *
	 * @param int    $term_id  Term ID.
	 * @param string $taxonomy Optional. Limit matched terms to those matching `$taxonomy`. Only used for
	 *                         disambiguating potentially shared terms.
	 * @return WP_Term

Métodos

  • __construct: constructor.
  • __get – Getter.
  • filter: desinfecta los campos de términos, de acuerdo con el tipo de filtro proporcionado.
  • get_instance: recupera la instancia de WP_Term.
  • to_array: convierte un objeto en una matriz.

Registro de cambios

Versión Descripción
4.4.0 Introducido.