1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// in functions.php

function shortcode_handler_table_data( $atts ) {
  global $WP_Table_Reloaded_Frontend;  

  $atts = shortcode_atts( array( 'id' => 0, 'c' => 0, 'r' => 0 ), $atts );
  $table_id = $atts['id'];
  $column = $atts['c'] - 1; // subtract 1 because of different array index
  $row = $atts['r'] - 1; // subtract 1 because of different array index

  $table = $WP_Table_Reloaded_Frontend->load_table( $table_id );
  $cell_content = $table['data'][$row][$column];
  //return do_shortcode( $WP_Table_Reloaded_Frontend->helper->safe_output( $cell_content ) );
  
 $render = $WP_Table_Reloaded_Frontend->create_class_instance( 'WP_Table_Reloaded_Render', 'render.class.php' );
 return do_shortcode( $render->safe_output( $cell_content ) );

}
add_shortcode( 'table_cell', 'shortcode_handler_table_data' );
?>


//template

<?php
/*
Template Name: Table Export
*/

global $post;
$args = array(
	'numberposts' => 1,
	'orderby' => 'post_title',
	'order' => 'DESC',
	'cat' => 1,
	'post_status' => 'publish'
);
$myposts = get_posts( $args );

foreach( $myposts as $post ) : setup_postdata($post); 
$theContent =  get_the_content();
$table_id = false;
if (preg_match('/\[table\ id=(\d*).*\]/im', $theContent, $r)) {
	if (isset($r[1])) {
		$table_id = $r[1];
	}
}

?>

<div><?php echo $theContent; ?> </div><br /><br />

Table id = <?php echo $table_id; ?><br />
Author = <?php do_shortcode('[table_cell id=15 c=1 r=1 /]') ?><br />
Bio = <?php do_shortcode('[table_cell id=15 c=1 r=2 /]') ?><br />


-------------------------------------------------------------------------------------------------------------------
 
<?php endforeach; ?>