PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.4.7
JetFormBuilder — Dynamic Blocks Form Builder v3.4.7
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 / components / compatibility / compatibility-tools.php
jetformbuilder / components / compatibility Last commit date
base-compat-dir-trait.php 2 years ago base-compat-handle-trait.php 2 years ago base-compat-url-trait.php 2 years ago compatibility-tools.php 2 years ago
compatibility-tools.php
67 lines
1 <?php
2
3
4 namespace JFB_Components\Compatibility;
5
6 use Jet_Form_Builder\Exceptions\Repository_Exception;
7 use JFB_Components\Module\Base_Module_Dir_It;
8 use JFB_Components\Module\Base_Module_Url_It;
9
10 // If this file is called directly, abort.
11 if ( ! defined( 'WPINC' ) ) {
12 die;
13 }
14
15 /**
16 * @since 3.1.0
17 *
18 * Class Compatibility_Tools
19 * @package JFB_Components\Compatibility
20 */
21 class Compatibility_Tools {
22
23 public static function get_url( string $module_name, string $url ): string {
24 try {
25 $module = jet_form_builder()->compat( $module_name );
26 } catch ( Repository_Exception $exception ) {
27 return '';
28 }
29
30 if ( ! ( $module instanceof Base_Module_Url_It ) ) {
31 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
32 _doing_it_wrong(
33 __METHOD__,
34 get_class( $module ) . ' is not implemented ' . Base_Module_Url_It::class,
35 '3.1.0'
36 );
37 // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
38 return '';
39 }
40
41 return $module->get_url( $url );
42 }
43
44 public static function get_dir( string $module_name, string $path ): string {
45 try {
46 $module = jet_form_builder()->compat( $module_name );
47 } catch ( Repository_Exception $exception ) {
48 return '';
49 }
50
51 if ( ! ( $module instanceof Base_Module_Dir_It ) ) {
52 // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
53 _doing_it_wrong(
54 __METHOD__,
55 get_class( $module ) . ' is not implemented ' . Base_Module_Dir_It::class,
56 '3.1.0'
57 );
58 // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
59
60 return '';
61 }
62
63 return $module->get_dir( $path );
64 }
65
66 }
67