find() Notation Options

Available find() notation options.

When it comes to find() notation, there are many useful options built into Pods. These work for the where, having, groupby, orderby, and select parameters of find(), the Pods Shortcode, and the Pods Item List Block.

Field Syntax Reference

Pods has field selection available in queries enabled by the aliases that it sets up based on the context of each pod.

The “t” prefix is the one that Pods relies on most. It will always alias on the primary table of the current pod, like “wp_posts” or “wp_terms”.

Other syntax depends on whether your Pod is using meta-based or table-based storage.

NotationDescription
t.*This syntax is used to reference the primary table. The alias “t” will automatically point at whichever table is set for the current pod.
my_custom_field.meta_valueReference the custom field “my_custom_field” for a Pod with meta-based storage. See the Relationship/File traversal information further below for relationship/file fields. You don’t need to define a custom field in Pods to be able to reference it like this.
d.my_custom_fieldReference the custom field “my_custom_field” for a Pod with table-based storage. See the Relationship/File traversal information further below for relationship/file fields.
d.*This syntax is used to reference the custom Pod table columns (stored as the “field_name” defined for each field) for Pods with table-based storage. If you are using an Advanced Content Type, you should always just use the “t” prefix.

Post Type / Media Pod Reference

Check out the full database reference of the wp_posts table (represented as “t” here).

NotationDescription
t.IDReference the post ID.
t.post_titleReference the post title.
t.post_dateReference the post date.
taxonomy_name.term_idReference the term ID for a built-in taxonomy connection.
taxonomy_name.*Reference any of the taxonomy fields for a built-in taxonomy connection.

Taxonomy Pod Reference

Check out the full database reference of the wp_terms table (represented as “t” here) or the wp_term_taxonomy table (represented as “tt” here).

NotationDescription
t.term_idReference the term ID.
t.nameReference the term name.
tt.descriptionReference the term description.

User Pod Reference

Check out the full database reference of the wp_users table (represented as “t” here).

NotationDescription
t.IDReference the user ID.
t.display_nameReference the user display name.

Comment Pod Reference

Check out the full database reference of the wp_comments table (represented as “t” here).

NotationDescription
t.comment_IDReference the comment ID.
t.comment_dateReference the comment date.

Relationship / File Field Traversal

You can traverse into any relationship or file field to get at information directly without having to write your own SQL JOINs.

NotationDescription
simple_relationship_field.meta_valueReference the related ID from the field “my_simple_relationship_field” for a simple relationship on a Pod with meta-based storage.
d.simple_relationship_fieldReference the related ID from the field “my_simple_relationship_field” for a simple relationship on a Pod with table-based storage.
my_relationship_field.IDReference the related ID from the field “my_relationship_field”.
my_file_field.IDReference the related ID from the field “my_file_field”.
*.another_relationship.IDYou can traverse as many levels as you would like into relationship or file fields.
*.custom_meta_field.meta_valueGet the value of a custom meta field (Pods with meta-based storage) on the related field.
*.custom_table_fieldGet the value of a custom table field (Pods with table-based storage) on the related field.

Other Helplful Documentation on pods() or go back to find()

add_to()

Add an item to the values of a relationship field.

add()

Add an item to a Pod.

data()

Return an array of all rows returned from a find() call.

delete()

Delete an item from the Pod.

display()

Return the output for a field.

do_magic_tags()

Replace magic tags with their values.

duplicate()

Duplicate an item.

exists()

Whether a Pod item exists or not when using fetch() or construct with an ID or slug.

export_data()

Export data from all items.

export()

Export an item’s data.

fetch()

Fetch an item from a Pod.

field()

Return the value for a field.

fields()

Return field array from a Pod, a field’s data, or a field option.

filters()

Output search filters to be used with find().

find()

Find items of a pod.

first_id()

Return the first item ID.

form()

Embed a form to add / edit a pod item from within your theme.

helper()

Run a helper within a Pod Page or WP Template.

id()

Return the item ID.

import()

Import data.

index()

Return the item name.

last_id()

Return the last item ID.

next_id()

Return the next item ID.

nth()

Fetch the nth state.

pagination()

Display the pagination controls.

position()

Fetch the current position in the loop.

prev_id()

Return the previous item ID.

raw()

Return the raw output for a field.

remove_from()

Remove values from fields.

reset_pod()

Delete all items from the Pod.

reset()

Reset the item position back to the start of the find() list.

row()

Return row array for an item.

save()

Save an item.

template()

Display the page template.

total_found()

Fetch to total number of rows found.

total()

Fetch the total row count.

valid()

Pod object validity.

zebra()

Fetch the zebra switch.