Plug-in implementation is required first, submit comments JSON data to a specific path, and then process the data.
Attempts to add hooks to parse the requested action.
function sync_comment($obj){ test($_POST);}add_action( 'parse_request', 'sync_comment' );
In fact, it is not feasible to get only GET
the data that POST
is empty.
Do not know is not cross-domain security issues, not familiar with WordPress, more tricky.
Find solution suggestions.
Reply content:
Plug-in implementation is required first, submit comments JSON data to a specific path, and then process the data.
Attempts to add hooks to parse the requested action.
function sync_comment($obj){ test($_POST);}add_action( 'parse_request', 'sync_comment' );
In fact, it is not feasible to get only GET
the data that POST
is empty.
Do not know is not cross-domain security issues, not familiar with WordPress, more tricky.
Find solution suggestions.
Check found that the request header is not committed can Content-Type: application/x-www-form-urlencoded
not parse $_post
It's better to change the solution.
$data = json_decode(file_get_contents("php://input"));