PHP Класс WPDKTerm

## Overview This class introducing a lot of feature for term management. $term = WPDKTerm::term( '%colors' ); // get by name $term = WPDKTerm::term( 'colors-house' ); // get by slug $term = WPDKTerm::term( 116 ); // get by id $term = WPDKTerm::term( 116, 'custom-tax' ); // get by id witha custom taxonomy $ancestor = WPDKTerm::ancestor( $term ); // get the ancestor (top parent)
Автор: =undo= ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$count
$description
$name
$parent
$parent_term
$permalink
$slug
$taxonomy
$term_group
$term_id
$term_taxonomy_id

Открытые методы

Метод Описание
ancestor ( ) : boolean | WPDKTerm Return the ancestor (top parent) WPDKTerm object. If FALSE no ancestor object found.
ancestorOfTerm ( WPDKterm $term ) : boolean | WPDKTerm Return the ancestor (top parent) WPDKTerm object. If FALSE no ancestor object found.
term ( integer | object | string $term, string $taxonomy = false, string $output = OBJECT, string $filter = 'raw', boolean $parent = false ) : WPDKTerm | WP_Error Return an instance of WPDKTerm class as extended-map of WordPress term.

Приватные методы

Метод Описание
__construct ( object $term ) : WPDKTerm Create an instance of WPDKTerm class

Описание методов

ancestor() публичный Метод

Return the ancestor (top parent) WPDKTerm object. If FALSE no ancestor object found.
public ancestor ( ) : boolean | WPDKTerm
Результат boolean | WPDKTerm

ancestorOfTerm() публичный статический Метод

Return the ancestor (top parent) WPDKTerm object. If FALSE no ancestor object found.
public static ancestorOfTerm ( WPDKterm $term ) : boolean | WPDKTerm
$term WPDKterm An instance of WPDKTerm class
Результат boolean | WPDKTerm

term() публичный статический Метод

Return an instance of WPDKTerm class as extended-map of WordPress term.
public static term ( integer | object | string $term, string $taxonomy = false, string $output = OBJECT, string $filter = 'raw', boolean $parent = false ) : WPDKTerm | WP_Error
$term integer | object | string If integer, will get from database. If object will apply filters and return $term. If string started with `%` will get by `get_term_by( 'name' )` Else if string will get by `get_term_by( 'slug' )`
$taxonomy string Optipnal. Taxonomy name that $term is part of. If FASLE retrive the term info
$output string Optional. Constant OBJECT, ARRAY_A, or ARRAY_N
$filter string Optional. Default is raw or no WordPress defined filter will applied.
$parent boolean Optional. If TRUE an object WPDKTerm is create in parent_term property
Результат WPDKTerm | WP_Error Term Row from database. Will return null if $term is empty. If taxonomy does not exist then WP_Error will be returned.

Описание свойств

$count публичное свойство

public $count

$description публичное свойство

public $description

$name публичное свойство

public $name

$parent публичное свойство

public $parent

$parent_term публичное свойство

public $parent_term

$slug публичное свойство

public $slug

$taxonomy публичное свойство

public $taxonomy

$term_group публичное свойство

public $term_group

$term_id публичное свойство

public $term_id

$term_taxonomy_id публичное свойство

public $term_taxonomy_id