PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / trunk
JetFormBuilder — Dynamic Blocks Form Builder vtrunk
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / compatibility / jet-engine / macros / base-field-context-macro.php
jetformbuilder / compatibility / jet-engine / macros Last commit date
auto-update-appointment-provider.php 2 months ago auto-update-appointment-service.php 2 months ago auto-update-field-value.php 2 months ago base-field-context-macro.php 2 months ago
base-field-context-macro.php
59 lines
1 <?php
2 /**
3 * Shared helpers for JetEngine macros that read JetFormBuilder field values.
4 *
5 * @package JFB_Compatibility\Jet_Engine\Macros
6 */
7
8 namespace JFB_Compatibility\Jet_Engine\Macros;
9
10 if ( ! defined( 'WPINC' ) ) {
11 die;
12 }
13
14 abstract class Base_Field_Context_Macro extends \Jet_Engine_Base_Macros {
15
16 protected function get_context_value( string $field_name ) {
17 $request_key = 'jfb_update_related_' . $field_name;
18
19 if (
20 isset( $GLOBALS['jfb_generator_context'] ) &&
21 is_array( $GLOBALS['jfb_generator_context'] ) &&
22 array_key_exists( $field_name, $GLOBALS['jfb_generator_context'] )
23 ) {
24 return $this->sanitize_value( $GLOBALS['jfb_generator_context'][ $field_name ] );
25 }
26
27 if ( isset( $_REQUEST[ $request_key ] ) ) {
28 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
29 return $this->sanitize_value( wp_unslash( $_REQUEST[ $request_key ] ) );
30 }
31
32 if ( isset( $GLOBALS[ $request_key ] ) ) {
33 return $this->sanitize_value( $GLOBALS[ $request_key ] );
34 }
35
36 if ( function_exists( 'jet_fb_context' ) ) {
37 $request_data = jet_fb_context()->resolve_request();
38
39 if ( isset( $request_data[ $field_name ] ) ) {
40 return $this->sanitize_value( $request_data[ $field_name ] );
41 }
42 }
43
44 return '';
45 }
46
47 protected function sanitize_value( $value ) {
48 if ( is_array( $value ) ) {
49 return $value;
50 }
51
52 if ( is_numeric( $value ) ) {
53 return $value;
54 }
55
56 return sanitize_text_field( $value );
57 }
58 }
59