WPDK  1.5.0
WordPress Development Kit
 All Data Structures Files Functions Variables Pages
WPDKTerms Class Reference

Public Member Functions

 __construct ($taxonomy= 'category')
 Construct. More...
 
 terms ()
 List of terms. More...
 
 tree ($child_of=false)
 Tree. More...
 
 breadCrumbs ($term)
 Bread Crumbs. More...
 
 term ($term)
 Get single term. More...
 

Data Fields

 $cache_domain
 
 $child_of
 Child of. More...
 
 $exclude
 Exclude. More...
 
 $exclude_tree
 
 $fields
 
 $get
 
 $hide_empty
 Hide empty categories. More...
 
 $hierarchical
 
 $include
 
 $name__like
 
 $number
 
 $offset
 
 $order
 Order. More...
 
 $orderby
 Order by. More...
 
 $pad_counts
 
 $parent
 
 $search
 
 $slug
 

Detailed Description

Experimental

Author
=undo= info@.nosp@m.wpxt.nosp@m.re.me
Date
2013-06-26
Version
1.0.0
Note
The difference between 'search' and 'name__like' is the leading '' in the LIKE clause. So search is 'search' and name__like is 'name__like'

Definition at line 180 of file wpdk-terms.php.

Constructor & Destructor Documentation

__construct (   $taxonomy = 'category')

Construct.

Create an instance of WPDKTerms class

Parameters
string | array$taxonomyOptional. Single or array of taxonomy ID. Default 'category'
Returns
WPDKTerms

Definition at line 375 of file wpdk-terms.php.

Member Function Documentation

breadCrumbs (   $term)

Bread Crumbs.

Return the array of term from parent

Parameters
int | object | string$termIf 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 byget_term_by( 'slug' )`
Returns
array

Definition at line 470 of file wpdk-terms.php.

term (   $term)

Get single term.

Return a single term by id, object, name or slug

Parameters
int | object | string$termIf 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 byget_term_by( 'slug' )`
Returns
WP_Error|WPDKTerm

Definition at line 496 of file wpdk-terms.php.

terms ( )

List of terms.

Return an array of term objects

get_terms()

Returns
array|WP_Error

Definition at line 414 of file wpdk-terms.php.

tree (   $child_of = false)

Tree.

Return a tree list of terms. Used to build an indent list of children

Parameters
bool$child_ofOptional. Default false
Returns
array|WP_Error

Definition at line 434 of file wpdk-terms.php.

Field Documentation

string $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'.

Definition at line 192 of file wpdk-terms.php.

int $child_of

Child of.

Get all descendents of this term. Default is 0.

Definition at line 200 of file wpdk-terms.php.

int string array $exclude

Exclude.

An array of term ids to exclude. Also accepts a string of comma-separated ids.

Definition at line 208 of file wpdk-terms.php.

array $exclude_tree

An array of parent term ids to exclude

Definition at line 216 of file wpdk-terms.php.

string $fields

Possible values:

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

Definition at line 231 of file wpdk-terms.php.

string $get

Default is nothing. Allow for overwriting 'hide_empty' and 'child_of', which can be done by setting the value to 'all'.

Definition at line 240 of file wpdk-terms.php.

bool $hide_empty

Hide empty categories.

Whether to return empty $terms.

true - Default (i.e. Do not show empty terms) false

Definition at line 251 of file wpdk-terms.php.

bool $hierarchical

Whether to include terms that have non-empty descendants (even if 'hide_empty' is set to true). 1 (true) - Default 0 (false)

Definition at line 261 of file wpdk-terms.php.

array $include

An array of term ids to include. Empty returns all.

Definition at line 269 of file wpdk-terms.php.

string $name__like

The term name you wish to match. It does a LIKE 'term_name' query. This matches terms that begin with the 'name__like' string.

Definition at line 278 of file wpdk-terms.php.

int $number

The maximum number of terms to return. Default is to return them all.

Definition at line 286 of file wpdk-terms.php.

int $offset

The number by which to offset the terms query.

Definition at line 294 of file wpdk-terms.php.

string $order

Order.

Possible values:

ASC - Default
DESC

Definition at line 305 of file wpdk-terms.php.

string $orderby

Order by.

Possible values:

id
count
name - Default
slug
term_group - Not fully implemented (avoid using)
none

Definition at line 320 of file wpdk-terms.php.

bool $pad_counts

If true, count all of the children along with the $terms. 1 (true) 0 (false) - Default

Definition at line 330 of file wpdk-terms.php.

int $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.

Definition at line 339 of file wpdk-terms.php.

string $search

The term name you wish to match. It does a LIKE 'term_name' query. This matches terms that contain the 'search' string.

Definition at line 348 of file wpdk-terms.php.

string $slug

Returns terms whose "slug" matches this value. Default is empty string.

Definition at line 356 of file wpdk-terms.php.


The documentation for this class was generated from the following file: