\WP_REST_Server::READABLE, 'callback' => array( $this, 'help' ), 'permission_callback' => static fn(): bool => current_user_can( Menu::CAPABILITY ), ), ) ); } public function help(): \WP_REST_Response { $tiles = array(); foreach ( $this->page->tiles() as $tile ) { $tiles[] = array( 'title' => $tile['title'], 'body' => $tile['body'], 'label' => $tile['label'], 'url' => esc_url_raw( $tile['url'] ), ); } return new \WP_REST_Response( array( 'tiles' => $tiles, 'report' => Help_Page::report_text( $this->page->report() ), ) ); } }