Plugin / Panda Pods Repeater Field

Dongjie Xu

Frequently Asked Questions (FAQ)

Please see the screenshots for instructions.
From Version 1.1.4, you can use pods_field(). e.g. in a single post template, pods_field( ‘field_name’ ) to fetch the data for the current page, otherwise use pods_field( ‘pods_name’, ‘post_id’, ‘field_name’ ) to fetch any data you want anywhere. To fetch data in the settings area, use pods_field( ‘pods_name’, false, ‘field_name’ ). To fetch data in the users area, use pods_field( ‘user’, ‘user_id’, ‘field_name’ ). You can use the filters: pandarf_pods_field_attrs( array(), $value_ukn, $row_arr, $params_arr, $pods_obj ) and pandarf_data_attrs( array(), $data_arr, $parentPod_str ) to alter the repeater data returned from pods_field(). From Version 1.1.6, if the field type is “file”, it will return the file ids, 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’ will now return the saved ID. You can also use this API to fetch data: pandarf_items_fn( $fields_arr, $atts_arr, $showQuery_bln ). Please see the Screenshots section for how to find ids. $fields_arr search 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 pod Panda Pod Repeater Field id ) $atts_arr for some basic mySQL commands (Optional) array( ‘where’ => ”, // exter where, 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 amount of rows in an array. ‘add_tb_prefix’ => true, // add $table_prefix to the table name. Default to ture ) $showQuery_bln If set to true, it will print out the sql command. For debugging purpose. Default to false. An example of basic usage. IDs from the Screenshots section: pandarf_items_fn( array( ‘child_pod_name’ => ‘comic_item’, ‘parent_pod_id’ => 2273, ‘parent_pod_post_id’ => 2275, ‘parent_pod_field_id’ => 2274 ) ); It will return the items attached to the post from Comic Contents.
You can use this API to insert data: pandarf_insert_fn( $fields_arr, $prf_arr, $showQuery_bln ). Please see the screenshots for how to find ids. $fields_arr extra fields other than panda repeater fields to insert: array( ‘field_name’ => ”, ‘field_name’ => ” … … ) $prf_arr the default repeater fields array( ‘child_pod_name’ => ”, // The name of the table for saving repeater field items. ‘parent_pod_id’ => ”, // main table pod id ‘parent_pod_post_id’ => ”, // main table post id ‘parent_pod_field_id’ => ”, // main table Panda Pods Pod Repeater Field id ‘user_id’ => 0 // The author id ‘add_tb_prefix’ => true, // add $table_prefix to the table name. Default to ture ) $showQuery_bln If set to true, it will print out the sql command. For debugging purpose. Default to false. This API will return the wpdb inserted ID if successful, or false on failure. An example of basic usage. IDs from the Screenshots section: $id_int = pandarf_insert_fn( array( ‘name’ => “hello panda” ), array( ‘child_pod_name’ => ‘comic_item’, ‘parent_pod_id’ => 2273, ‘parent_pod_post_id’ => 2275, ‘parent_pod_field_id’ => 2274, ‘user_id’ => $current_user->ID ) );
add_filter(‘pprf_load_panda_repeater_allow_input’, ‘pprf_allow_frontend_input_fn’, 10, 7 ); /** * The repeater field is only for admin area. If you want it to be available for the frontend users, you can use this filter * Please note nested fields are treated as frontend even the parent field loaded in the admin. No soluction for now * * @param boolean $allow_bln allow the input item to be displayed * @param array $inAdmin_bln is in the admin area * @param string $name * @param mixed $value * @param array $options * @param array $pod * @param int $id * @return boolean still allow or not */ function pprf_allow_frontend_input_fn( $allow_bln, $inAdmin_bln, $name_str, $value_ukn, $options_arr, $pod_obj, $id_int ){ if( !is_admin() ){ if( $pod_obj->pod == ‘your_pod_slug’ ){ $allow_bln = true; } } return $allow_bln; } add_filter(‘pprf_load_panda_repeater_allow’, ‘pprf_allow_fn’, 11, 2); /** * The repeater field is only for logged in users with edit_posts capability * If you want it to be available for the frontend users, you can use this filter * * @param boolean $allow_bln allow the form to be displayed * @param array $get_arr variables from $_GET * @return boolean still allow or not */ function pprf_allow_fn( $allow_bln, $get_arr ){ $pod_obj = pods('your_pod_slug'); if( $get_arr['podid'] == $pod_obj->pod_id ){ $allow_bln = true; } return $allow_bln; }

Ratings

4.3
6 reviews

Rating breakdown

Details Information

Version

1.4.4

First Released

17 Oct, 2016

Total Downloads

6,883

Wordpress Version

3.8 or higher

Tested up to:

5.2.4

Require PHP Version:

-

Tags

Contributors

This plugin has been closed.

Languages

The plugin hasn't been transalated in any language other than English.

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.