PluginProbe ʕ •ᴥ•ʔ
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More / 1.10.1
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More v1.10.1
1.10.1 1.10.0.5 trunk 1.1.4 1.1.4.2 1.1.5 1.1.5.1 1.1.6 1.1.6.1 1.1.7 1.1.7.1 1.1.7.2 1.1.8 1.1.8.1 1.1.8.2 1.1.8.3 1.1.8.4 1.10.0.1 1.10.0.2 1.10.0.3 1.10.0.4 1.2.0 1.2.0.1 1.2.1 1.2.2 1.2.2.1 1.2.2.2 1.2.3 1.2.3.1 1.2.3.2 1.2.4 1.2.4.1 1.2.5 1.2.5.1 1.2.6 1.2.7 1.2.8 1.2.8.1 1.2.9 1.3.0 1.3.1 1.3.1.1 1.3.1.2 1.3.2 1.3.3 1.3.5 1.3.6 1.3.6.1 1.3.6.2 1.3.7.2 1.3.7.3 1.3.7.4 1.3.8 1.3.9.1 1.4.0.1 1.4.1.1 1.4.2 1.4.2.1 1.4.2.2 1.4.3 1.4.4 1.4.4.1 1.4.5 1.4.5.1 1.4.5.2 1.4.5.3 1.4.6 1.4.7.1 1.4.7.2 1.4.8.1 1.4.9 1.5.0.1 1.5.0.3 1.5.0.4 1.5.1 1.5.1.1 1.5.1.3 1.5.2.1 1.5.2.2 1.5.2.3 1.5.3 1.5.3.1 1.5.4.1 1.5.4.2 1.5.5 1.5.5.1 1.5.6 1.5.6.2 1.5.7 1.5.8.2 1.5.9.1 1.5.9.4 1.5.9.5 1.6.0.1 1.6.0.2 1.6.1 1.6.2.2 1.6.2.3 1.6.3.1 1.6.4 1.6.4.1 1.6.5 1.6.6 1.6.7 1.6.7.1 1.6.7.2 1.6.7.3 1.6.8 1.6.8.1 1.6.9 1.7.0 1.7.1.1 1.7.1.2 1.7.2 1.7.2.1 1.7.3 1.7.4 1.7.4.1 1.7.4.2 1.7.5.1 1.7.5.2 1.7.5.3 1.7.5.5 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.7.9.1 1.8.0.1 1.8.0.2 1.8.1.1 1.8.1.2 1.8.1.3 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.3.1 1.8.4 1.8.4.1 1.8.5.2 1.8.5.3 1.8.5.4 1.8.6.2 1.8.6.3 1.8.6.4 1.8.7.2 1.8.8.2 1.8.8.3 1.8.9.1 1.8.9.2 1.8.9.4 1.8.9.5 1.8.9.6 1.9.0.1 1.9.0.2 1.9.0.3 1.9.0.4 1.9.1.1 1.9.1.2 1.9.1.3 1.9.1.4 1.9.1.5 1.9.1.6 1.9.2.1 1.9.2.2 1.9.2.3 1.9.3.1 1.9.3.2 1.9.4.1 1.9.4.2 1.9.5 1.9.5.1 1.9.5.2 1.9.6 1.9.6.1 1.9.6.2 1.9.7.1 1.9.7.2 1.9.7.3 1.9.8.1 1.9.8.2 1.9.8.4 1.9.8.7 1.9.9.2 1.9.9.3 1.9.9.4
wpforms-lite / includes / integrations.php
wpforms-lite / includes Last commit date
admin 6 days ago emails 4 months ago fields 6 days ago functions 6 days ago providers 10 months ago templates 4 months ago class-db.php 1 year ago class-fields.php 1 year ago class-form.php 6 days ago class-install.php 1 year ago class-process.php 4 months ago class-providers.php 1 year ago class-templates.php 2 years ago class-widget.php 1 year ago deprecated.php 8 months ago functions-list.php 3 years ago functions.php 11 months ago integrations.php 4 months ago
integrations.php
131 lines
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 /**
8 * Register and setup WPForms as a Visual Composer element.
9 *
10 * @since 1.3.0
11 *
12 * @noinspection PhpUndefinedFunctionInspection
13 */
14 function wpforms_visual_composer_shortcode() {
15
16 if ( ! is_user_logged_in() ) {
17 return;
18 }
19
20 $form_obj = wpforms()->obj( 'form' );
21
22 if ( ! $form_obj ) {
23 return;
24 }
25
26 $wpf = $form_obj->get(
27 '',
28 [
29 'orderby' => 'title',
30 ]
31 );
32
33 if ( ! empty( $wpf ) ) {
34 $forms = [
35 esc_html__( 'Select a form to display', 'wpforms-lite' ) => '',
36 ];
37
38 foreach ( $wpf as $form ) {
39 $forms[ $form->post_title ] = $form->ID;
40 }
41 } else {
42 $forms = [
43 esc_html__( 'No forms found', 'wpforms-lite' ) => '',
44 ];
45 }
46
47 vc_map(
48 [
49 'name' => esc_html__( 'WPForms', 'wpforms-lite' ),
50 'base' => 'wpforms',
51 'icon' => WPFORMS_PLUGIN_URL . 'assets/images/sullie-vc.png',
52 'category' => esc_html__( 'Content', 'wpforms-lite' ),
53 'description' => esc_html__( 'Add your form', 'wpforms-lite' ),
54 'params' => [
55 [
56 'type' => 'dropdown',
57 'heading' => esc_html__( 'Form', 'wpforms-lite' ),
58 'param_name' => 'id',
59 'value' => $forms,
60 'save_always' => true,
61 'description' => esc_html__( 'Select a form to add it to your post or page.', 'wpforms-lite' ),
62 'admin_label' => true,
63 ],
64 [
65 'type' => 'dropdown',
66 'heading' => esc_html__( 'Display Form Name', 'wpforms-lite' ),
67 'param_name' => 'title',
68 'value' => [
69 // phpcs:ignore WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
70 esc_html__( 'No', 'wpforms-lite' ) => 'false',
71 esc_html__( 'Yes', 'wpforms-lite' ) => 'true',
72 ],
73 'save_always' => true,
74 'description' => esc_html__( 'Would you like to display the forms name?', 'wpforms-lite' ),
75 'dependency' => [
76 'element' => 'id',
77 'not_empty' => true,
78 ],
79 ],
80 [
81 'type' => 'dropdown',
82 'heading' => esc_html__( 'Display Form Description', 'wpforms-lite' ),
83 'param_name' => 'description',
84 'value' => [
85 // phpcs:ignore WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
86 esc_html__( 'No', 'wpforms-lite' ) => 'false',
87 esc_html__( 'Yes', 'wpforms-lite' ) => 'true',
88 ],
89 'save_always' => true,
90 'description' => esc_html__( 'Would you like to display the form description?', 'wpforms-lite' ),
91 'dependency' => [
92 'element' => 'id',
93 'not_empty' => true,
94 ],
95 ],
96 ],
97 ]
98 );
99 }
100 add_action( 'vc_before_init', 'wpforms_visual_composer_shortcode' );
101
102 /**
103 * Load our basic CSS when in Visual Composer's frontend editor.
104 *
105 * @since 1.3.0
106 */
107 function wpforms_visual_composer_shortcode_css() {
108
109 $min = wpforms_get_min_suffix();
110
111 // Load CSS per global setting.
112 if ( wpforms_setting( 'disable-css', '1' ) === '1' ) {
113 wp_enqueue_style(
114 'wpforms-full',
115 WPFORMS_PLUGIN_URL . "assets/css/frontend/classic/wpforms-full{$min}.css",
116 [],
117 WPFORMS_VERSION
118 );
119 }
120
121 if ( wpforms_setting( 'disable-css', '1' ) === '2' ) {
122 wp_enqueue_style(
123 'wpforms-base',
124 WPFORMS_PLUGIN_URL . "assets/css/frontend/classic/wpforms-base{$min}.css",
125 [],
126 WPFORMS_VERSION
127 );
128 }
129 }
130 add_action( 'vc_load_iframe_jscss', 'wpforms_visual_composer_shortcode_css' );
131