[table-info id=N field="<field-name>"/] can be used to display table meta data in a post, page, or text widget.
You can show this data in the same way as tables by using the Shortcode
[table-info id=N field="<field-name>" /]
The Shortcode has three parameters:
- id (string) (required)
- The ID of the table that has the Custom Data Field
- field (string) (required)
- The name of a meta field (see below)
- only possible value:
raw. Only applies to the default field
last_modifiedand will return the raw datetime format instead of the pretty string.
Possible values for field are:
- The name of the table with ID id
- The description of the table with ID id
- The time of the last modification of the table with ID id, if the
formatparameter is set to
raw, a datetime string will be returned, otherwise a pretty string. The format
humancan be used to show a text like “5 hours ago”, the format values
timeshow just the date or time of the last modification, respectively.
- The author who last modified the table with ID id
Example of three Shortcodes in action (i.e. in a post or on a page near a table):
The table [table-info id=2 field="name" /] was last modified at [table-info id=2 field="last_modified" format="raw" /] by [table-info id=2 field="last_editor" /].
will produce something similar to
The table Demo Table was last modified at 2017-01-30 15:20:21 by TobiasBg.
There’s a also a Template Tag Function for this Shortcode available:
<?php tablepress_table_info( 'id=1&field=name' ); ?>
It works exactly as the Template Tag Function described below, with the parameters from this section.