From version 1.1.4, you can use pods_field(). For example, in a single post template, use pods_field( ‘field_name’ ) to fetch data for the current page. Otherwise, use pods_field( ‘pods_name’, ‘post_id’, ‘field_name’ ) to fetch data anywhere. To fetch data from the settings area, use pods_field( ‘pods_name’, false, ‘field_name’ ). To fetch data from the users area, use pods_field( ‘user’, ‘user_id’, ‘field_name’ ).
You can use these filters to alter the repeater data returned from pods_field(): pandarf_pods_field_attrs( array(), $value_ukn, $row_arr, $params_arr, $pods_obj ) and pandarf_data_attrs( array(), $data_arr, $parent_pod_name ).
From version 1.1.6, if the field type is “file”, it returns the file IDs. You can then use WordPress APIs like get_attached_file(), wp_get_attachment_image_src(), etc. to get the file details. Relation types of ‘user’, ‘post type’, ‘pod’ and ‘media’ return the saved ID.
You can also use this API to fetch data: pandarf_items_fn( $fields_arr, $attrs, $show_query ). Please see the Screenshots section for how to find IDs.
Use $fields_arr to search the repeater field table: array( ‘id’ => ”, // row ID ‘name’ => ”, // the common name field used by Pods ‘child_pod_name’ => ”, // repeater table name ‘parent_pod_id’ => ”,// main table Pod ID ‘parent_pod_post_id’ => ”, // main table post ID ‘parent_pod_field_id’ => ”, // main table Panda Pods Repeater Field ID )
$attrs supports some basic MySQL commands (optional): array( ‘where’ => ”, // extra WHERE clause, expected to be escaped ‘order’ => ‘ASC’, ‘order_by’ => ‘pandarf_order’, ‘group_by’ => ”, ‘start’ => 0, ‘limit’ => 0, ‘count_only’ => false, // if true, it will return the number of rows in an array. ‘add_tb_prefix’ => true, // add $table_prefix to the table name. Defaults to true )
$show_query If set to true, it will print the SQL command for debugging. Defaults to false.
Basic usage example. The IDs are from the Screenshots section: get_pandarf_items( array( ‘child_pod_name’ => ‘comic_item’, ‘parent_pod_id’ => 2273, ‘parent_pod_post_id’ => 2275, ‘parent_pod_field_id’ => 2274 ) ); Use pandarf_items_fn for versions before v1.4.11.
This returns the Comic Contents items attached to the post.