How to do Ajax in WordPress

updated 10th Jan 2018 Write a javascript function to trigger the ajax call jQuery(‘#button_or_something’).on(“click”, function() { jQuery.ajax({ url: ajax_object.ajax_url, data: { action: ‘like_or_not’, /* this is appended to add_action on server side */ id: ’99’ }, type: ‘GET’, success:function(response){ //alert(‘back from ajaxe ‘+response); /* if you want to update something based on the response text … Read more

Handy Woocommerce SQL queries

This post is just a place to store handy SQL queries for Woocommerce. Get Order and all its information select p.ID as order_id, p.post_date, pm.* from wp_posts p join wp_postmeta pm on p.ID = pm.post_id join wp_woocommerce_order_items oi on p.ID = oi.order_id where post_type = ‘shop_order’ and p.ID = 14223 Generate an Orders report and … Read more