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

Public Member Functions

 ancestor ()
 Ancestor. More...
 

Static Public Member Functions

static term ($term, $taxonomy=false, $output=OBJECT, $filter= 'raw', $parent=false)
 Get term. More...
 
static ancestorOfTerm (WPDKterm $term)
 Ancestor. More...
 

Data Fields

 $count
 
 $description
 
 $name
 
 $parent
 
 $parent_term
 
 $slug
 
 $taxonomy
 
 $term_group
 
 $term_id
 
 $term_taxonomy_id
 
 $permalink
 

Detailed Description

A replacement experimental of standrd WordPress term object.

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)
Author
=undo= info@.nosp@m.wpxt.nosp@m.re.me
Date
2013-09-17
Version
1.0.2

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

Member Function Documentation

ancestor ( )

Ancestor.

Return the ancestor (top parent) WPDKTerm object. If FALSE no ancestor object found.

Returns
bool|WPDKTerm

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

static ancestorOfTerm ( WPDKterm  $term)
static

Ancestor.

Return the ancestor (top parent) WPDKTerm object. If FALSE no ancestor object found.

Parameters
WPDKTerm$termAn instance of WPDKTerm class
Returns
bool|WPDKTerm

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

static term (   $term,
  $taxonomy = false,
  $output = OBJECT,
  $filter = 'raw',
  $parent = false 
)
static

Get term.

Return an instance of WPDKTerm class as extended-map of WordPress term.

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' )`
string$taxonomyOptipnal. Taxonomy name that $term is part of. If FASLE retrive the term info
string$outputOptional. Constant OBJECT, ARRAY_A, or ARRAY_N
string$filterOptional. Default is raw or no WordPress defined filter will applied.
bool$parentOptional. If TRUE an object WPDKTerm is create in parent_term property
Returns
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.

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

Field Documentation

$count

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

$description

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

$name

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

$parent

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

$parent_term

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

$permalink

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

$slug

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

$taxonomy

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

$term_group

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

$term_id

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

$term_taxonomy_id

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


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