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
/** * Scribe to Email list form template. * * @since 1.0.0 */ class WPForms_Template_Subscribe extends WPForms_Template {
/** * Primary class constructor. * * @since 1.0.0 */ public function init() {
$this->name = esc_html__( 'Newsletter Signup Form', 'wpforms-lite' ); $this->slug = 'subscribe'; $this->description = esc_html__( 'Add subscribers and grow your email list with this newsletter signup form. You can add and remove fields as needed.', 'wpforms-lite' ); $this->includes = ''; $this->icon = ''; $this->core = true; $this->modal = array( 'title' => esc_html__( 'Don't Forget', 'wpforms-lite' ), 'message' => esc_html__( 'Click the marketing tab to configure your newsletter service provider', 'wpforms-lite' ), ); $this->data = array( 'field_id' => '2', 'fields' => array( '0' => array( 'id' => '0', 'type' => 'name', 'label' => esc_html__( 'Name', 'wpforms-lite' ), 'required' => '1', 'size' => 'medium', ), '1' => array( 'id' => '1', 'type' => 'email', 'label' => esc_html__( 'Email', 'wpforms-lite' ), 'required' => '1', 'size' => 'medium', ), ), 'settings' => array( 'antispam' => '1', 'confirmation_message_scroll' => '1', 'submit_text_processing' => esc_html__( 'Sending...', 'wpforms-lite' ), ), 'meta' => array( 'template' => $this->slug, ), ); }
/** * Conditional to determine if the template informational modal screens * should display. * * @since 1.0.0 * * @param array $form_data Form data and settings. * * @return bool */ public function template_modal_conditional( $form_data ) {
// If we do not have provider data, then we can assume a provider // method has not yet been configured, so we display the modal to // remind the user they need to set it up for the form to work // correctly. if ( empty( $form_data['providers'] ) ) { return true; }
return false; } }
new WPForms_Template_Subscribe();
|