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 5.6+
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
Argument | Type | Description |
---|---|---|
name | string | The pod name |
singular_label | string | The singular item name (defaults to whatever the Pod uses) |
plural_label | string | The plural item name (defaults to whatever the Pod uses) |
fields | string | The list of fields to show (comma-separated); Default is to show all fields (may cause slow performance) |
searchable | boolean | Whether the table should be searchable; Default is 0; Use 0/1 for format here |
search_across | boolean | Whether to search across all fields on the pod; Default is 0; Use 0/1 for format here |
search_across_picks | boolean | Whether to search across relationship fields; Default is 0; Use 0/1 for format here (may cause slow performance) |
search_fields | string | The list of fields to be searched (comma-separated); Default is to search all fields if search_across is enabled (may cause slow performance) |
sortable | boolean | Whether the table should be sortable; Default is 0; Use 0/1 for format here |
sort_fields | string | The list of fields to be sortable (comma-separated); Default is to allow sorting on any field (may cause slow performance on meta-based fields) |
pagination | boolean | Whether the table should be paginated; Default is 1; Use 0/1 for format here (no pagination may cause slow performance with large datasets) |
pagination_total | boolean | Whether the table should show the total number of items; Default is 0; Use 0/1 for format here |
pagination_type | string | The pagination type to use; Default is paginate; Options: simple, advanced, list, paginate, table |
pagination_location | string | The location for where to show pagination; Default is after; Options: before / after / both |
limit | integer | The number of items to show per page; Default is 25; Options: Any number above 0, or -1 for unlimited |
offset | integer | The item position offset to use, this is NOT the page number; Default is 0; Options: Any non-negative number |
orderby | string | Order By SQL clause |
where | string | Where SQL clause |
having | string | Having SQL clause |
groupby | string | Group By SQL clause |
select | string | Select SQL clause for optimizing the query |
join | string | Join 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 );