Add-On: List Tables

Introduces a new [pods-table] shortcode and Pods List Table Block for Pods 2.8+.

Requirements

Requires WordPress 5.5+, Pods 2.7.28+, and PHP 7.2+

To use the Pods List Table Block, you will need Pods 2.8+ installed.

What does this add-on do?

List your content within searchable, sortable, and paginated tables

The [pods-table] shortcode and Pods List Tables Block allow you to easily embed multiple tables throughout your content. Each of them functions independently and can offer searching, sorting, and pagination of table content.

Example: Show all fields for the pod

[pods-table name="your_pod"]

Example: Show specific fields for the pod

[pods-table name="your_pod" fields="post_title,field1,field2"]

Example: Show specific fields for the pod (all items from the database).

Warning: Using queries that do not limit to a maximum number (default: 1000) can produce problematic performance issues on your site.

[pods-table name="your_pod" fields="post_title,field1,field2" limit="-1"]

Example: find() parameter support

See the find() doc page for more parameters. Each parameter in the shortcode should be prefixed with “pods_”.

[pods-table id=123 name="your_pod" where="field1.meta_value = '1'"]

Full list of supported shortcode arguments

ArgumentTypeDescription
namestringThe pod name
singular_labelstringThe singular item name (defaults to whatever the Pod uses)
plural_labelstringThe plural item name (defaults to whatever the Pod uses)
fieldsstringThe list of fields to show (comma-separated); Default is to show all fields (may cause slow performance)
searchablebooleanWhether the table should be searchable; Default is 0; Use 0/1 for format here
search_acrossbooleanWhether to search across all fields on the pod; Default is 0; Use 0/1 for format here
search_across_picksbooleanWhether to search across relationship fields; Default is 0; Use 0/1 for format here (may cause slow performance)
search_fieldsstringThe list of fields to be searched (comma-separated); Default is to search all fields if search_across is enabled (may cause slow performance)
sortablebooleanWhether the table should be sortable; Default is 0; Use 0/1 for format here
sort_fieldsstringThe list of fields to be sortable (comma-separated); Default is to allow sorting on any field (may cause slow performance on meta-based fields)
paginationbooleanWhether the table should be paginated; Default is 1; Use 0/1 for format here (no pagination may cause slow performance with large datasets)
pagination_totalbooleanWhether the table should show the total number of items; Default is 0; Use 0/1 for format here
pagination_typestringThe pagination type to use; Default is paginate; Options: simple, advanced, list, paginate, table
pagination_locationstringThe location for where to show pagination; Default is after; Options: before / after / both
limitintegerThe number of items to show per page; Default is 25; Options: Any number above 0, or -1 for unlimited
offsetintegerThe item position offset to use, this is NOT the page number; Default is 0; Options: Any non-negative number
orderbystringOrder By SQL clause
wherestringWhere SQL clause
havingstringHaving SQL clause
groupbystringGroup By SQL clause
selectstringSelect SQL clause for optimizing the query
joinstringJoin SQL clause

You can further customize through filters

There are filters available to further customize the integration to suit your needs. See below for how those filters get used.

/**
 * Allow filtering the Pods UI options used.
 *
 * @since 1.0.0
 *
 * @param array $ui_options List of Pods UI options.
 * @param array $args       List of Pods UI arguments provided.
 * @param Pods  $pod        The pod object.
 */
$ui_options = apply_filters( 'pods_pro_list_tables_pods_ui_options', $ui_options, $args, $pod );

/**
 * Allow filtering the Pods UI output.
 *
 * @since 1.0.0
 *
 * @param string $ui_output  The Pods UI output.
 * @param array  $args       List of Pods UI arguments provided.
 * @param Pods   $pod        The pod object.
 * @param array  $ui_options List of Pods UI options.
 */
$ui_output = apply_filters( 'pods_pro_list_tables_pods_ui_output', $ui_output, $args, $pod, $ui_options );