This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
studentersamfundet.no/wp/wp-content/plugins/json-api/controllers/respond.php
T
nikolark e903bd6114 Fixes tiled event display and JSON feed of events.
* New version of neuf-events
* New version of WP-JSON-API
* Renames event.event to event.event_type_parents in JSON-feed.
2014-01-11 20:15:56 +01:00

28 lines
770 B
PHP

<?php
/*
Controller name: Respond
Controller description: Comment/trackback submission methods
*/
class JSON_API_Respond_Controller {
function submit_comment() {
global $json_api;
nocache_headers();
if (empty($_REQUEST['post_id'])) {
$json_api->error("No post specified. Include 'post_id' var in your request.");
} else if (empty($_REQUEST['name']) ||
empty($_REQUEST['email']) ||
empty($_REQUEST['content'])) {
$json_api->error("Please include all required arguments (name, email, content).");
} else if (!is_email($_REQUEST['email'])) {
$json_api->error("Please enter a valid email address.");
}
$pending = new JSON_API_Comment();
return $pending->handle_submission();
}
}
?>