From 0556eee2d5fb306e2c0f706bf71049f0f2f98eba Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Mon, 8 Feb 2021 16:08:24 -0800 Subject: [PATCH] feat: actually expand the table by the selected pod --- tablepress-pods.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tablepress-pods.php b/tablepress-pods.php index d463016..aa4c820 100644 --- a/tablepress-pods.php +++ b/tablepress-pods.php @@ -3,7 +3,7 @@ Plugin Name: TablePress Extension: Pods tables Plugin URI: https://code.studioinfinity.org/glen/tablepress-pods Description: Custom Extension for TablePress to incorporate Pods information in tables -Version: 0.2.15 +Version: 0.2.16 Author: Glen Whitney Author URI: http://studioinfinity.org/ */ @@ -204,10 +204,12 @@ function playground_handle_exportpods () { $_REQUEST['_wpnonce'] = wp_create_nonce( TablePress::nonce( 'export' ) ); /* Set up the filter using the pod params */ - $pod_name = $export['pod_name'] - $filter = function( $data, $tab, $fmt, $delim ) use ($pod_name) { - return $data . "\nExpanded by " . $pod_name; - } + $r_opts = array('pod_name' => $export['pod_name']); + $filter = function( $data, $tab, $fmt, $delim ) use ($r_opts) { + $newtab = playground_expand_pod($tab, $r_opts); + $exporter = TablePress::load_class( 'TablePress_Export', 'class-export.php', 'classes' ); + return $exporter->export_table( $newtab, $fmt, $delim ); + }; /* Temporarily set a filter on exporting */ add_filter( 'tablepress_export_data', $filter, 10, 4);