Overview
The filter hook ctdqb_get_post_data allows you to modify or extend the post data array that is collected for each post within the Query Builder loop. This filter provides access to all the gathered post information and enables you to add custom data or modify existing values before the post is rendered.
Hook Parameters
- $props – Array of module properties.
- $post_data – Array containing all collected post data and metadata.
Understanding the Post Data Array
The $post_data
array contains comprehensive information about each post:
Core Post Data
id
– Post IDtitle
– Post titletype
– Post typemime
– MIME type array (for attachments)permalink
– Post URLclasses
– Array of post CSS classes
Author Information
author
– Author display nameauthor_id
– Author user IDauthor_a
– Author avatar HTMLauthor_link
– Author archive URL
Date Information
published
– Published date (formatted)modified
– Last modified date (formatted)
Content Data
excerpt
– Post excerpt (when enabled)content
– Post content (when content display is enabled)cc
– Comment count array
Media Data
img_html
– Featured image HTMLimg_url
– Featured image URLimg_caption
– Image captionimg_data
– Array with full image URL and title
Taxonomy Data
term_links
– Array of associated taxonomy terms with links
Custom Fields
custom_fields
– Array of custom field datacustom_fields_html
– Rendered custom fields HTMLcf_link
– Custom field link value
WooCommerce Data (for products)
woo
– Array containing product-specific data like price, SKU, stock, etc.
Divi Layout Data
dl_content
– Divi layout content (when enabled)
0 Comments