function custom_breadcrumbs_taxonomy_node_get_recent_term in Custom Breadcrumbs 6.2
Same name and namespace in other branches
- 7.2 custom_breadcrumbs_taxonomy/custom_breadcrumbs_taxonomy.inc \custom_breadcrumbs_taxonomy_node_get_recent_term()
Returns the most recently selected term for a given node.
Parameters
$node: The node object.
Return value
The previously selected taxonomy term object that also belongs to the node.
1 call to custom_breadcrumbs_taxonomy_node_get_recent_term()
- custom_breadcrumbs_taxonomy_node_get_term in custom_breadcrumbs_taxonomy/
custom_breadcrumbs_taxonomy.inc - Returns the previous selected term or the lightest term for a given node.
File
- custom_breadcrumbs_taxonomy/
custom_breadcrumbs_taxonomy.inc, line 142 - Helper functions for custom_breadcrumbs_taxonomy.
Code
function custom_breadcrumbs_taxonomy_node_get_recent_term($node) {
$terms = taxonomy_node_get_terms($node);
$tid = _custom_breadcrumbs_taxonomy_recent_term();
if (is_array($terms) && !empty($terms) && !is_null($tid)) {
return isset($terms[$tid]) ? taxonomy_get_term($tid) : NULL;
}
}