Add an "Export Pods Table" action to the TablePress menu #6
@ -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.10
|
||||
Version: 0.2.11
|
||||
Author: Glen Whitney
|
||||
Author URI: http://studioinfinity.org/
|
||||
*/
|
||||
@ -189,7 +189,7 @@ function playground_expand_pod( $table, $render_options) {
|
||||
}
|
||||
|
||||
function playground_handle_exportpods () {
|
||||
TablePress::check_nonce( 'export' );
|
||||
TablePress::check_nonce( 'exportpods' );
|
||||
|
||||
if ( ! current_user_can( 'tablepress_export_tables' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to access this page.', 'default' ), 403 );
|
||||
@ -201,6 +201,9 @@ function playground_handle_exportpods () {
|
||||
$export = wp_unslash( $_POST['export'] );
|
||||
}
|
||||
|
||||
TablePress::redirect( array( 'action' => 'export', 'export' => $export ), true );
|
||||
}
|
||||
/*
|
||||
$exporter = TablePress::load_class( 'TablePress_Export', 'class-export.php', 'classes' );
|
||||
|
||||
if ( empty( $export['tables'] ) ) {
|
||||
@ -324,4 +327,5 @@ function playground_handle_exportpods () {
|
||||
flush();
|
||||
echo $download_data;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
@ -162,9 +162,9 @@ class TablePress_ExportPods_View extends TablePress_View {
|
||||
<select id="tables-export-pod-name" name="export[pod_name]">
|
||||
<?php
|
||||
foreach ( $data['pods'] as $pod) {
|
||||
$pod_name = $pod['name];
|
||||
$pod_name = $pod['name'];
|
||||
$selected = selected( $pod_name, $data['pod_name'], false );
|
||||
echo "<option{$selected} value=\"{$pod_name}\"?{$pod_name}</option>";
|
||||
echo "<option{$selected} value=\"{$pod_name}\">{$pod_name}</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
Loading…
Reference in New Issue
Block a user