\WP_REST_Server::CREATABLE, 'callback' => array( self::class, 'disconnect' ), 'permission_callback' => static function (): bool { return current_user_can( 'manage_options' ); }, ), ) ); } /** * POST disconnect. */ public static function disconnect(): WP_REST_Response { Google_OAuth::instance()->disconnect(); return new WP_REST_Response( array( 'message' => __( 'Disconnected from Google Drive.', '4wp-drive' ) ), 200 ); } }