Hi,
you are lucky, I found the email in which I had mailed the necessary code to someone over a year ago ??
Here is the code:
<?php
// handle [table_data id=123 c=4 r=5 /]
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 ) );
}
add_shortcode( 'table_cell', 'shortcode_handler_table_data' );
?>
If you copy this code (you probably don’t need the <?php
and ?>
) into your theme’s “functions.php”, you will have a new shortcode, like this:
[table_cell id=123 c=4 r=5 /]
This will return the content (and just the content) of row 5, column 4 of table 123. (I shortened the parameters to “c” and “r”, to have smaller shortcodes. And I did not include any checks though, if the table/row/column really exist, so in those cases you will get a PHP parse error.)
This should be what you want though ??
Best wishes,
Tobias