PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.7
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.7
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
← All changes | classes/async-operation/queries/operation-query.php +12 -1 1.2.01.7.7 View file →
@@ -2,8 +2,9 @@
2 2
3 3 namespace ImageOptimization\Classes\Async_Operation\Queries;
4 4
5 5 use ImageOptimization\Classes\Async_Operation\Async_Operation_Hook;
6 +use ImageOptimization\Classes\Async_Operation\Async_Operation_Queue;
6 7 use ImageOptimization\Classes\Async_Operation\Interfaces\Operation_Query_Interface;
7 8 use TypeError;
8 9
9 10 if ( ! defined( 'ABSPATH' ) ) {
@@ -14,12 +15,22 @@
14 15 private array $query;
15 16
16 17 public function set_hook( string $hook ): self {
17 18 if ( ! in_array( $hook, Async_Operation_Hook::get_values(), true ) ) {
18 - throw new TypeError( "Hook $hook is not a part of Async_Operation_Hook values" );
19 + throw new TypeError( esc_html( "Hook $hook is not a part of Async_Operation_Hook values" ) );
19 20 }
20 21
21 22 $this->query['hook'] = $hook;
23 +
24 + return $this;
25 + }
26 +
27 + public function set_queue( string $queue ): self {
28 + if ( ! in_array( $queue, Async_Operation_Queue::get_values(), true ) ) {
29 + throw new TypeError( esc_html( "Queue $queue is not a part of Async_Operation_Queue values" ) );
30 + }
31 +
32 + $this->query['group'] = $queue;
22 33
23 34 return $this;
24 35 }
25 36