[table-info id=N field=<field-name> /]Code language: JSON / JSON with Comments (json)
can be used to display table meta data in a post, page, or text widget.
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 /].Code language: HTML, XML (xml)
will produce something similar to
The table Demo Table was last modified at 2022-12-20 15:20:21 by TobiasBg.Code language: HTML, XML (xml)
There’s a also a Template Tag Function for this Shortcode available:
'id=1&field=name' );tablepress_table_info( Code language: PHP (php)
It works exactly like the Template Tag Function, with the parameters from this section.