From 0307f2897a0be129cce5a48d89e870058c48447e Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Mon, 8 Feb 2021 10:34:03 -0800 Subject: [PATCH] fix: add filter to redirect exportpods view here --- tablepress-pods.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tablepress-pods.php b/tablepress-pods.php index 93efd82..2300d17 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.4 +Version: 0.2.5 Author: Glen Whitney Author URI: http ://studioinfinity.org/ */ @@ -58,7 +58,8 @@ Street, Fifth Floor, Boston, MA 02110-1301 , USA. add_filter( 'tablepress_shortcode_table_default_shortcode_atts', 'playground_add_shortcode_parameter_pods' ); add_filter( 'tablepress_table_raw_render_data', 'playground_expand_pod', 10, 2 ); -add_filter( 'tablepress_admin_view_actions', 'playground_add_export_pod_action') +add_filter( 'tablepress_admin_view_actions', 'playground_add_export_pod_action'); +add_filter( 'tablepress_load_file_full_path', 'playground_exportpods_path'); function playground_add_shortcode_parameter_pods( $default_atts ) { $default_atts['pod_name'] = ''; @@ -75,12 +76,16 @@ function playground_add_export_pod_action( $view_actions ) { 'nav_tab_title' => _x( 'Export Pods', 'navigation bar', 'tablepress' ), 'required_cap' => 'tablepress_export_tables', ); - /* unset($view_actions['import']); */ return $view_actions; } +function playground_exportpods_path( $fullpath, $filename, $directory ) { + if ($filename !== 'view-exportpods.php') return $fullpath; + return plugin_dir_path( __FILE__ ) . $filename; +} + function playground_expand_pod( $table, $render_options) { - if (empty($render_options['pod_name'])) return $table; + if (empty($render_options['pod_name'])) return $table; $pod_params = array('limit'=>-1); if (!empty($render_options['pod_where'])) { $pod_params['where'] = $render_options['pod_where'];