Skip to content

Instantly share code, notes, and snippets.

@anka
Created April 7, 2023 18:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Example implementation of a Wordpress function to process a POST request
function process_data_submission(WP_REST_Request $request) {
$data = json_decode($request->get_body(), true);
// Perform your data processing here
$response = new WP_REST_Response(array('status' => 'success', 'message' => 'Data processed successfully'));
$response->set_status(200);
return $response;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment