Overview
The ctdqb_get_term_data filter hook allows you to modify or extend the term data array that is collected for each taxonomy term within the Query Builder loop. This filter provides access to all the gathered term information and enables you to add custom data or modify existing values before the term is rendered.
Hook Parameters
- $props – Array of module properties.
- $term_data -Array containing all collected term data and metadata.
Understanding the Term Data Array
The $term_data
array contains comprehensive information about each taxonomy term:
Core Term Data
id
– Term IDtitle
– Term namepermalink
– Term archive URLtaxonomy
– Taxonomy nameslug
– Term slugdescription
– Term description
Term Hierarchy
parent
– Parent term ID (0 if no parent)level
– Hierarchical level (0 for top-level terms)term_group
– Term group IDterm_taxonomy_id
– Term taxonomy relationship ID
Statistics
count
– Number of objects associated with this term
Media
img_html
– Term image HTML (when image display is enabled)
Custom Fields
custom_fields
– Array of custom field datacustom_fields_html
– Rendered custom fields HTMLcf_link
– Custom field link value
Divi Layout Data
dl_content
– Divi layout content (when enabled)
0 Comments