PHP Class Timber\Term

Inheritance: extends Core, implements Timber\CoreInterface
显示文件 Open project: jarednova/timber Class Usage Examples

Public Properties

Property Type Description
$PostClass
$TermClass
$_children
$name the human-friendly name of the term (ex: French Cuisine)
$object_type
$representation
$taxonomy the WordPress taxonomy slug (ex: post_tag or actors)

Public Methods

Method Description
__construct ( integer $tid = null, string $tax = '' )
__toString ( ) : string
children ( ) : array
description ( ) : string
edit_link ( ) : string
from ( $tid, $taxonomy ) : static
get_children ( ) : array
get_edit_url ( ) : string
get_link ( ) : string
get_meta_field ( string $field_name ) : string
get_path ( ) : string
get_posts ( integer $numberposts = 10, string $post_type = 'any', string $PostClass = '' ) : array | boolean | null Get Posts that have been "tagged" with the particular term
link ( ) : string
meta ( string $field_name ) : string
path ( ) : string
posts ( integer $numberposts_or_args = 10, string $post_type_or_class = 'any', string $post_class = '' ) : array | boolean | null
title ( ) : string
update ( string $key, mixed $value )

Protected Methods

Method Description
get_term ( integer $tid ) : mixed
get_term_from_query ( ) : integer
get_term_meta ( integer $tid ) : array
get_tid ( integer $tid ) : integer
init ( integer $tid )

Method Details

__construct() public method

public __construct ( integer $tid = null, string $tax = '' )
$tid integer
$tax string

__toString() public method

public __toString ( ) : string
return string

children() public method

public children ( ) : array
return array

description() public method

public description ( ) : string
return string

from() public static method

public static from ( $tid, $taxonomy ) : static
$tid
$taxonomy
return static

get_children() public method

public get_children ( ) : array
return array

get_edit_url() public method

public get_edit_url ( ) : string
return string

get_meta_field() public method

public get_meta_field ( string $field_name ) : string
$field_name string
return string

get_path() public method

Deprecation: since 1.0
public get_path ( ) : string
return string

get_posts() public method

Get Posts that have been "tagged" with the particular term
public get_posts ( integer $numberposts = 10, string $post_type = 'any', string $PostClass = '' ) : array | boolean | null
$numberposts integer
$post_type string
$PostClass string
return array | boolean | null

get_term() protected method

protected get_term ( integer $tid ) : mixed
$tid integer
return mixed

get_term_from_query() protected method

protected get_term_from_query ( ) : integer
return integer

get_term_meta() protected method

protected get_term_meta ( integer $tid ) : array
$tid integer
return array

get_tid() protected method

protected get_tid ( integer $tid ) : integer
$tid integer
return integer

init() protected method

protected init ( integer $tid )
$tid integer

meta() public method

public meta ( string $field_name ) : string
$field_name string
return string

path() public method

public path ( ) : string
return string

posts() public method

public posts ( integer $numberposts_or_args = 10, string $post_type_or_class = 'any', string $post_class = '' ) : array | boolean | null
$numberposts_or_args integer
$post_type_or_class string
$post_class string
return array | boolean | null

title() public method

public title ( ) : string
return string

update() public method

public update ( string $key, mixed $value )
$key string
$value mixed

Property Details

$PostClass public_oe property

public $PostClass

$TermClass public_oe property

public $TermClass

$_children public_oe property

public $_children

$name public_oe property

the human-friendly name of the term (ex: French Cuisine)
public $name

$object_type public_oe property

public $object_type

$representation public_oe static_oe property

public static $representation

$taxonomy public_oe property

the WordPress taxonomy slug (ex: post_tag or actors)
public $taxonomy