PHP 클래스 WPDKTerms

저자: =undo= ([email protected])
파일 보기 프로젝트 열기: wpxtreme/wpdk

공개 프로퍼티들

프로퍼티 타입 설명
$cache_domain string In WordPress Version 3.2 and above. The 'cache_domain' argument enables a unique cache key to be produced when the query produced by get_terms() is stored in object cache. For instance, if you are using one of this function's filters to modify the query (such as 'terms_clauses'), setting 'cache_domain' to a unique value will not overwrite the cache for similar queries. Default value is 'core'.
$child_of integer Get all descendents of this term. Default is 0.
$exclude integer | string | array An array of term ids to exclude. Also accepts a string of comma-separated ids.
$exclude_tree array An array of parent term ids to exclude
$fields string all - returns an array of term objects - Default ids - returns an array of integers names - returns an array of strings count - (3.2+) returns the number of terms found id=>parent - returns an associative array where the key is the term id and the value is the parent term id if present or 0
$get string Allow for overwriting 'hide_empty' and 'child_of', which can be done by setting the value to 'all'.
$hide_empty boolean true - Default (i.e. Do not show empty terms) false
$hierarchical boolean 1 (true) - Default 0 (false)
$include array An array of term ids to include. Empty returns all.
$name__like string This matches terms that begin with the 'name__like' string.
$number integer The maximum number of terms to return. Default is to return them all.
$offset integer The number by which to offset the terms query.
$order string ASC - Default DESC
$orderby string id count name - Default slug term_group - Not fully implemented (avoid using) none
$pad_counts boolean 1 (true) 0 (false) - Default
$parent integer Get direct children of this term (only terms whose explicit parent is this value). If 0 is passed, only top-level terms are returned. Default is an empty string.
$search string This matches terms that contain the 'search' string.
$slug string Returns terms whose "slug" matches this value. Default is empty string.

공개 메소드들

메소드 설명
__construct ( string | array $taxonomy = 'category' ) : WPDKTerms Create an instance of WPDKTerms class
breadCrumbs ( integer | object | string $term ) : array Return the array of term from parent
term ( integer | object | string $term ) : WP_Error | WPDKTerm Return a single term by id, object, name or slug
terms ( ) : array | WP_Error Return an array of term objects
tree ( boolean $child_of = false ) : array | WP_Error Return a tree list of terms. Used to build an indent list of children

메소드 상세

__construct() 공개 메소드

Create an instance of WPDKTerms class
public __construct ( string | array $taxonomy = 'category' ) : WPDKTerms
$taxonomy string | array Optional. Single or array of taxonomy ID. Default 'category'
리턴 WPDKTerms

breadCrumbs() 공개 메소드

Return the array of term from parent
public breadCrumbs ( integer | object | string $term ) : array
$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' )`
리턴 array

term() 공개 메소드

Return a single term by id, object, name or slug
public term ( integer | object | string $term ) : WP_Error | WPDKTerm
$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' )`
리턴 WP_Error | WPDKTerm

terms() 공개 메소드

Return an array of term objects
public terms ( ) : array | WP_Error
리턴 array | WP_Error

tree() 공개 메소드

Return a tree list of terms. Used to build an indent list of children
public tree ( boolean $child_of = false ) : array | WP_Error
$child_of boolean Optional. Default false
리턴 array | WP_Error

프로퍼티 상세

$cache_domain 공개적으로 프로퍼티

In WordPress Version 3.2 and above. The 'cache_domain' argument enables a unique cache key to be produced when the query produced by get_terms() is stored in object cache. For instance, if you are using one of this function's filters to modify the query (such as 'terms_clauses'), setting 'cache_domain' to a unique value will not overwrite the cache for similar queries. Default value is 'core'.
public string $cache_domain
리턴 string

$child_of 공개적으로 프로퍼티

Get all descendents of this term. Default is 0.
public int $child_of
리턴 integer

$exclude 공개적으로 프로퍼티

An array of term ids to exclude. Also accepts a string of comma-separated ids.
public int|string|array $exclude
리턴 integer | string | array

$exclude_tree 공개적으로 프로퍼티

An array of parent term ids to exclude
public array $exclude_tree
리턴 array

$fields 공개적으로 프로퍼티

all - returns an array of term objects - Default ids - returns an array of integers names - returns an array of strings count - (3.2+) returns the number of terms found id=>parent - returns an associative array where the key is the term id and the value is the parent term id if present or 0
public string $fields
리턴 string

$get 공개적으로 프로퍼티

Allow for overwriting 'hide_empty' and 'child_of', which can be done by setting the value to 'all'.
public string $get
리턴 string

$hide_empty 공개적으로 프로퍼티

true - Default (i.e. Do not show empty terms) false
public bool $hide_empty
리턴 boolean

$hierarchical 공개적으로 프로퍼티

1 (true) - Default 0 (false)
public bool $hierarchical
리턴 boolean

$include 공개적으로 프로퍼티

An array of term ids to include. Empty returns all.
public array $include
리턴 array

$name__like 공개적으로 프로퍼티

This matches terms that begin with the 'name__like' string.
public string $name__like
리턴 string

$number 공개적으로 프로퍼티

The maximum number of terms to return. Default is to return them all.
public int $number
리턴 integer

$offset 공개적으로 프로퍼티

The number by which to offset the terms query.
public int $offset
리턴 integer

$order 공개적으로 프로퍼티

ASC - Default DESC
public string $order
리턴 string

$orderby 공개적으로 프로퍼티

id count name - Default slug term_group - Not fully implemented (avoid using) none
public string $orderby
리턴 string

$pad_counts 공개적으로 프로퍼티

1 (true) 0 (false) - Default
public bool $pad_counts
리턴 boolean

$parent 공개적으로 프로퍼티

Get direct children of this term (only terms whose explicit parent is this value). If 0 is passed, only top-level terms are returned. Default is an empty string.
public int $parent
리턴 integer

$slug 공개적으로 프로퍼티

Returns terms whose "slug" matches this value. Default is empty string.
public string $slug
리턴 string