How to use Datatable with Ajax when creating plugin on WordPress?

Solution to my own problem: Enqueue your custom file.js and localize admin-ajax.php. index.php function script_enqueue() { // Register the JS file with a unique handle, file location, and an array of dependencies wp_register_script(“dt_csc”, plugin_dir_url(__FILE__). ‘js/cdt.js’, array(‘jquery’)); // localize the script to your domain name, so that you can reference the url to admin-ajax.php file easily … Read more

How to check and get json object in WP database?

To check if a string from database is like a:2:{i:3;a:4:{s:5:”title”;s:0:””;s:4:”text”;s:503:”…}}, you can use the function is_serialized() To get the data as php array : if(is_serialized($data_as_string)){ $data_as_array = unserialize( $data_as_string); }