| 1 | <?php |
||
| 7 | class Carbon_Breadcrumb_Item_Term extends Carbon_Breadcrumb_Item_DB_Object { |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Term object. |
||
| 11 | * |
||
| 12 | * @access public |
||
| 13 | * @var object |
||
| 14 | */ |
||
| 15 | public $term_object; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Configure the title and link URL by using the specified term ID. |
||
| 19 | * |
||
| 20 | * @access public |
||
| 21 | */ |
||
| 22 | 3 | public function setup() { |
|
| 23 | // in order to continue, taxonomy term ID must be specified |
||
| 24 | 3 | if ( ! $this->get_id() ) { |
|
| 25 | 1 | throw new Carbon_Breadcrumb_Exception( 'The term breadcrumb items must have term ID specified.' ); |
|
| 26 | } |
||
| 27 | |||
| 28 | // in order to continue, taxonomy must be specified |
||
| 29 | 2 | if ( ! $this->get_subtype() ) { |
|
| 30 | 1 | throw new Carbon_Breadcrumb_Exception( 'The term breadcrumb items must have taxonomy specified.' ); |
|
| 31 | } |
||
| 32 | |||
| 33 | // retrieve term object |
||
| 34 | 1 | $subtype = $this->get_subtype(); |
|
| 35 | 1 | $this->term_object = get_term_by( 'id', $this->get_id(), $subtype ); |
|
| 36 | |||
| 37 | 1 | parent::setup(); |
|
| 38 | 1 | } |
|
| 39 | |||
| 40 | /** |
||
| 41 | * Setup the title of this item. |
||
| 42 | * |
||
| 43 | * @access public |
||
| 44 | */ |
||
| 45 | 1 | public function setup_title() { |
|
| 49 | |||
| 50 | /** |
||
| 51 | * Setup the link of this item. |
||
| 52 | * |
||
| 53 | * @access public |
||
| 54 | */ |
||
| 55 | 1 | public function setup_link() { |
|
| 59 | |||
| 60 | } |