PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.0.0
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.0.0
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
image-optimization / modules / oauth / rest / disconnect.php

disconnect.php in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.0.0, at modules/oauth/rest/disconnect.php

33 lines 672 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ImageOptimizer\Modules\Oauth\Rest;
4
5 use ImageOptimizer\Modules\Oauth\Classes\Route_Base;
6 use ImageOptimizer\Modules\Oauth\Components\Connect;
7 use WP_REST_Request;
8
9 class Disconnect extends Route_Base {
10 const NONCE_NAME = 'image-optimizer-disconnect';
11
12 protected string $path = 'disconnect';
13
14 public function get_name(): string {
15 return 'disconnect';
16 }
17
18 public function get_methods(): array {
19 return [ 'POST' ];
20 }
21
22 public function POST( WP_REST_Request $request ) {
23 $this->verify_nonce_and_capability(
24 $request->get_param( self::NONCE_NAME ),
25 self::NONCE_NAME
26 );
27
28 Connect::disconnect();
29
30 return $this->respond_success_json();
31 }
32 }
33