PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.14.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.14.0
2.14.0 2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 All 81 releases
← All changes | includes/frontend/dynamic-content/argument-parser.php +4 -2 2.9.1 → 2.14.0 View file →
@@ -9,12 +9,14 @@
9 9 protected array $args;
10 10 protected array $interpreters;
11 11 protected string $arg_str;
12 12 protected bool $is_richtext;
13 - public function __construct( string $arg_str, bool $is_richtext, array $interpreters ) {
13 + protected $context;
14 + public function __construct( string $arg_str, bool $is_richtext, array $interpreters, array $context = [] ) {
14 15 $this->arg_str = $arg_str;
15 16 $this->is_richtext = $is_richtext;
16 17 $this->interpreters = $interpreters;
18 + $this->context = $context;
17 19 }
18 20 public function interpret() : ?Interpreters\Abstracts\Interpreter {
19 21 $setting = explode( '|', $this->arg_str );
20 22 $action_name = $setting[0];
@@ -21,9 +23,9 @@
21 23 array_shift( $setting );
22 24
23 25 if ( ! empty( $class = $this->interpreters[ $action_name ] ?? '' ) &&
24 26 class_exists( $class ) &&
25 - ( $ins = new $class( $action_name, $setting, $this->is_richtext ) ) instanceof Interpreters\Abstracts\Interpreter
27 + ( $ins = new $class( $action_name, $setting, $this->is_richtext, $this->context ) ) instanceof Interpreters\Abstracts\Interpreter
26 28 ) {
27 29 return $ins;
28 30 }
29 31 return null;