Ad Inserter
94Manage Google AdSense ads, banners, ad rotation, sticky widgets, AMP ads, ads.txt, tracking, header and footer...
ACF field type to select a TablePress table
ACF: TablePress is a WordPress plugin that serves as an extension for the Advanced Custom Fields (ACF) and TablePress plugins. It allows you to create a custom field type that lets you select a TablePress table from a dropdown menu. This plugin requires both ACF and TablePress to function, as it does not operate independently.
When you select a table using this custom field, it can return either the table ID or the full HTML of the table. This feature is useful for developers looking to integrate TablePress tables into their custom fields in WordPress sites.
Best for: This plugin is suitable for developers using ACF and TablePress who want to streamline table selection in custom fields.
What it does well
Where it falls short
ACF: TablePress is a functional tool for those already using ACF and TablePress, but it lacks standalone capabilities.
TylerDigital's own description of ACF: TablePress, lightly tidied.
This is an extension for the popular Advanced Custom Fields plugin and TablePress plugin. By itself, this plugin does NOTHING.
This add-on for Advanced Custom Fields creates a custom field type to select a TablePress table, providing a dropdown menu that lets you select from a list of available tables. The field can return the table ID for the table selected, or the full HTML of the table.
This plugin requires:
Just to be sure there’s no confusion… This plugin does nothing unless ACF (Or ACF Pro) and TablePress are both active on your site
Follow this plugin on GitHub
This field can return the table ID for the table selected, or the full HTML of the table (the same output as the rendered shortcode).
When returning the table ID, either of the following code snippets will output your table (replacing ‘your_table_here’ with the field name you defined in your ACF Field Group settings).
<?php
$tablepress_id = get_field( 'your_field_here' );
echo do_shortcode( '[table id="'.$tablepress_id.'"]' );
?>
or, to avoid using do_shortcode(), use
<?php
$tablepress_id = get_field( 'your_field_here' );
$args = array(
'id' => $tablepress_id,
);
if ( function_exists( 'tablepress_print_table' ) ) {
tablepress_print_table( $args );
}
?>
To simply display the chosen table on your page, choose the HTML output option in your field settings, and insert into your php with
the_field( 'your_field_here' );
For a more detailed explanation, see our article, Setting up an ACF field for TablePress.
Other plugins for custom content structures.
Manage Google AdSense ads, banners, ad rotation, sticky widgets, AMP ads, ads.txt, tracking, header and footer...
ACF helps customize WordPress with powerful, professional and intuitive fields. Proudly powering over 2 millio...
Checkout Field Editor (Checkout Manager) for WooCommerce – The best WooCommerce checkout manager plugin to man...
Easily reorder posts, pages, custom post types, and taxonomies with intuitive drag-and-drop sorting in the Wor...
The #1 user-rated activity log plugin for event logging, activity monitoring and change tracking.
Admin UI for creating custom content types like post types and taxonomies