Hi,
thanks for your question, and sorry for the trouble.
Sorry, I don’t have a readily available solution for this, but you could e.g. look at https://tablepress.org/extensions/random-row/ for some ideas on how to adjust the code.
Regards,
Tobias
Thanks for replying! I don’t know how to program, but if it would help, I could donate $30-40 for this!
I use another wordpress plugin called “random text”, but I would rather use only tablepress, since that plugin is seems not to be updated more.
Hi,
extending the Single Cell Shortcode Extension is actually not too difficult here.
Just change line 40 from
$row = absint( $shortcode_atts['row'] );
to
if ( 'random' === $shortcode_atts['row'] ) {
$shortcode_atts['row'] = rand( 1, count( $table['data'] ) );
}
$row = absint( $shortcode_atts['row'] );
After that, you could use a Shortcode like
[table-cell id=123 row=random column=3 /]
to get a random cell from column 3.
Regards,
Tobias
Awesome! You just replaced this plugin for me:
https://wordpress.org/plugins/randomtext/
As a humble thank you:
You've authorized a 3,00 USD monthly donation to
#####.tablepress.###
-
This reply was modified 8 years ago by
bjarnee.
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
And thanks for the donation, I really appreciate this!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!