← All changes
|
modules/optimization/rest/get-bulk-optimization-images.php
+6
-1
1.7.4
→
1.7.7
View file →
| @@ -7,9 +7,8 @@ | ||
| 7 | 7 | Route_Base, |
| 8 | 8 | }; |
| 9 | 9 | |
| 10 | 10 | use Throwable; |
| 11 | -use WP_REST_Request; | |
| 12 | 11 | |
| 13 | 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | 13 | exit; // Exit if accessed directly. |
| 15 | 14 | } |
| @@ -25,8 +24,14 @@ | ||
| 25 | 24 | return [ 'GET' ]; |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | 27 | public function GET() { |
| 28 | + $error = $this->verify_capability(); | |
| 29 | + | |
| 30 | + if ( $error ) { | |
| 31 | + return $error; | |
| 32 | + } | |
| 33 | + | |
| 29 | 34 | try { |
| 30 | 35 | $images = Bulk_Optimization_Controller::get_processed_images(); |
| 31 | 36 | |
| 32 | 37 | return $this->respond_success_json([ |