-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtypeform-vc.php
80 lines (78 loc) · 2.04 KB
/
typeform-vc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
add_action( 'vc_before_init', 'tf_embed_vc' );
function tf_embed_vc() {
vc_map(
array(
"name" => __( "Typeform", "typeform" ),
"base" => "typeform_embed",
"icon" => TYPEFORM_EMBED_PLUGIN_URL . "assets/images/tf-vc.jpg",
"category" => __( "Content", "typeform"),
"description" => __("Embed beautiful forms and surveys", "typeform"),
"params" => array(
array(
"type" => "textfield",
"class" => "",
"heading" => __( "Typeform URL", "typeform" ),
"param_name" => "url",
"admin_label" => true,
"description" => __( "Your typeform's url found in Share section.", "typeform" )
),
array(
"type" => "dropdown",
"heading" => __("Embed Type", "typeform"),
"admin_label" => true,
"value" => array(
__("Embed", "typeform") => "embed",
__("Classic", "typeform") => "classic",
__("Drawer", "typeform") => "drawer"
),
"param_name" => "type"
),
array(
"type" => "textfield",
"class" => "",
"heading" => __( "Width", "typeform" ),
"param_name" => "width",
"dependency" => array(
"element" => "type",
"value" => array("embed")
)
),
array(
"type" => "textfield",
"class" => "",
"heading" => __( "Height", "typeform" ),
"param_name" => "height",
"value" => "500px",
"dependency" => array(
"element" => "type",
"value" => array("embed")
)
),
array(
"type" => "dropdown",
"heading" => __("Link style", "typeform"),
"value" => array(
__("Link", "typeform") => "link",
__("Button", "typeform") => "button"
),
"param_name" => "style",
"dependency" => array(
"element" => "type",
"value" => array("classic", "drawer")
)
),
array(
"type" => "textfield",
"class" => "",
"heading" => __( "Button Text", "typeform" ),
"param_name" => "button_text",
"dependency" => array(
"element" => "type",
"value" => array("classic", "drawer")
)
)
)
)
);
}