Created
July 11, 2013 18:27
-
-
Save dphiffer/5977900 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Controller name: Post controller | |
Controller description: A hacky way to get /api/posts/[id] to work | |
*/ | |
class JSON_API_Post_Controller { | |
function error() { | |
global $json_api; | |
if (preg_match('#^/api/post/(\d+)#', $_SERVER['REQUEST_URI'], $matches)) { | |
$_REQUEST['id'] = $matches[1]; | |
} | |
require WP_CONTENT_DIR . '/plugins/json-api/controllers/core.php'; | |
$core_controller = new JSON_API_Core_Controller(); | |
return $core_controller->get_post(); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment