WordPress Functions
These functions retrieve WordPress objects and return full provider objects, so you can chain property access.
| Function | Returns | Description | Example |
|---|---|---|---|
get_post | Post | Single post by ID | {{ get_post(42).title }} |
get_posts | Collection | Posts by query args | {{ get_posts({post_type: 'page'}) }} |
get_term | Term | Single term by ID | {{ get_term(5).name }} |
get_terms | Collection | Terms by query args | {{ get_terms({taxonomy: 'category'}) }} |
get_user | User | Single user by ID | {{ get_user(1).display_name }} |
get_users | Collection | Users by query args | {{ get_users({role: 'author'}) }} |
get_image | Image | Single image by ID | {{ get_image(100).src('medium') }} |
Single Object Functions
Retrieve a specific object by ID and access any of its fields:
{{ get_post(42).title }}
{{ get_post(42).date('F j, Y') }}
{{ get_term(3).name }}
{{ get_term(3).link }}
{{ get_user(1).display_name }}
{{ get_user(1).avatar(96) }}
{{ get_image(thumbnail_id).src('medium') }}
Collection Functions
Retrieve multiple objects using query arguments. Returns a collection that can be iterated in a Loop or accessed directly:
{{ get_posts({post_type: 'page', posts_per_page: 5}) }}
{{ get_terms({taxonomy: 'category', hide_empty: true}) }}
{{ get_users({role: 'author'}) }}
Collection results also expose query metadata:
{{ get_posts({post_type: 'post'}).found_posts }}
Security
WordPress functions enforce security: viewable post types only, permission checks on non-public statuses, MIME type validation for images, and capability-based field restrictions.