/** * Register the page-related routes * * @param array $routes Existing routes * @return array Modified routes */ public function register_routes($routes) { $routes = parent::register_routes($routes); $routes = parent::register_revision_routes($routes); $routes = parent::register_comment_routes($routes); // Add post-by-path routes $routes[$this->route] = array('get_post_by_path' => array(array($this, 'get_post_by_path'), WP_JSON_Server::READABLE), "edit_post_by_path" => array(array($this, 'edit_post_by_path'), WP_JSON_Server::EDITABLE | WP_JSON_Server::ACCEPT_JSON), "delete_post_by_path" => array(array($this, 'delete_post_by_path'), WP_JSON_Server::DELETABLE)); return $routes; }
public function register_routes($routes) { $routes = parent::register_routes($routes); $routes = parent::register_revision_routes($routes); return $routes; }