How I can load tablepress via ajax?
-
I’m run
echo do_shortcode('[table id=1 /]');
in my ajax. But it don’t run shortcode. It show ‘[table id=1 /]’
Tell me where I wrong?FUll code
add_action( 'wp_ajax_load_tablepress', array( $this, 'load_tablepress_func') ); add_action( 'wp_ajax_nopriv_load_tablepress', array( $this, 'load_tablepress_func') ); function load_tablepress_func(){ ob_start(); echo do_shortcode('[table id=1 /]'); $content = ob_get_clean(); wp_send_json_success($content); die(); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How I can load tablepress via ajax?’ is closed to new replies.