getRestPoints() as $obj) { $obj->register(); } } protected function initRestObjs() { if (is_multisite()) { $this->restObjs[] = new RESTPoint('/multisite/subsite/new', function (\WP_REST_Request $data) { $posts = get_posts(array( 'author' => $data['id'], )); if (empty($posts)) { return null; } return $posts[0]->post_title; }); } } }