Skip to content

Instantly share code, notes, and snippets.

View arnaimbd's full-sized avatar

Arifur Rahman Naim arnaimbd

View GitHub Profile
@arnaimbd
arnaimbd / ajax-action.php
Created October 18, 2016 08:59
Debuging ajax call on WordPress
<?php
add_action( "wp_ajax_stock_form", function() {
if ( !isset( $_POST['data'] ) ) {
wp_send_json_error( ['msg' => 'Wrong data'] );
}
$args = [];
wp_parse_str( $_POST['data'], $args );