I\'m implementing a wordpress frontend php page which holds a list of hyperlinks in the body and a wpdatatable in the footer.
I want to reload the data table each time t
You need to change your function to:
function tenders_shortcode() {
echo do_shortcode("[wpdatatable id=49 var1=".$_POST['id']." var2=".$GLOBALS['cgv']['archive']."]");
wp_die(); //Added
}
add_action('wp_ajax_tenders_shortcode', 'tenders_shortcode'); // add action for logged users
add_action( 'wp_ajax_nopriv_tenders_shortcode', 'tenders_shortcode' ); // add action for unlogged users
Without wp_die() at the end of the function it will never return anything other than zero.