PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.14
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.14
7.8.14 7.8.14.1 7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / inc / metas / class-hustle-meta-base-emails.php
wordpress-popup / inc / metas Last commit date
default-design 5 months ago popup 5 months ago slidein 3 years ago sshare 5 months ago class-hustle-meta-base-content.php 3 years ago class-hustle-meta-base-design.php 3 years ago class-hustle-meta-base-display.php 6 years ago class-hustle-meta-base-emails.php 4 months ago class-hustle-meta-base-integrations.php 3 years ago class-hustle-meta-base-settings.php 3 years ago class-hustle-meta-base-visibility.php 5 months ago
class-hustle-meta-base-emails.php
126 lines
1 <?php
2 /**
3 * File for Hustle_Meta_Base_Emails class.
4 *
5 * @package Hustle
6 * @since 4.2.0
7 */
8
9 /**
10 * Hustle_Meta_Base_Emails is the base class for the "emails" meta of modules.
11 * This class should handle what's related to the "emails" meta.
12 *
13 * @since 4.2.0
14 */
15 class Hustle_Meta_Base_Emails extends Hustle_Meta {
16
17 /**
18 * Returns the defaults for merging purposes.
19 * Avoid overwritting the saved form elements when the default fields aren't present.
20 *
21 * @since 4.4.1
22 *
23 * @return array
24 */
25 protected function get_defaults_for_merge() {
26 $defaults = $this->get_defaults();
27
28 // Avoid overwritting the saved form elements when the default fields aren't present.
29 if ( isset( $defaults['form_elements'] ) && ! empty( $this->data['form_elements'] ) ) {
30 unset( $defaults['form_elements'] );
31 }
32 return $defaults;
33 }
34
35 /**
36 * Get the defaults for this meta.
37 *
38 * @since 4.2.0
39 *
40 * @return array
41 */
42 public function get_defaults() {
43 return array(
44 'form_elements' => $this->get_default_form_fields(),
45 'after_successful_submission' => 'show_success',
46 'success_message' => '',
47 'auto_close_success_message' => '0',
48 'auto_close_time' => 5,
49 'auto_close_unit' => 'seconds',
50 'redirect_url' => '',
51 'automated_email' => '0',
52 'email_time' => 'instant',
53 'recipient' => '{email}',
54 'notification_email_recipient' => get_option( 'admin_email' ),
55 'notification_email' => '0',
56 'notification_email_subject' => '',
57 'notification_email_body' => '',
58 'day' => '',
59 'time' => '',
60 'auto_email_time' => '5',
61 'schedule_auto_email_time' => '5',
62 'auto_email_unit' => 'seconds',
63 'schedule_auto_email_unit' => 'seconds',
64 'email_subject' => '',
65 'email_body' => '',
66 'automated_file' => '0',
67 'auto_download_file' => '',
68 'redirect_tab' => '',
69 );
70 }
71
72 /**
73 * Default form fields for new modules.
74 *
75 * @since the beginning of time
76 *
77 * @return array
78 */
79 public static function get_default_form_fields() {
80
81 $default_fields = array(
82 'first_name' => array(
83 'required' => 'false',
84 'label' => __( 'First Name', 'hustle' ),
85 'name' => 'first_name',
86 'type' => 'name',
87 'placeholder' => 'John',
88 'can_delete' => true,
89 ),
90 'last_name' => array(
91 'required' => 'false',
92 'label' => __( 'Last Name', 'hustle' ),
93 'name' => 'last_name',
94 'type' => 'name',
95 'placeholder' => 'Smith',
96 'can_delete' => true,
97 ),
98 'email' => array(
99 'required' => 'true',
100 'label' => __( 'Your email', 'hustle' ),
101 'name' => 'email',
102 'type' => 'email',
103 'placeholder' => 'johnsmith@example.com',
104 'validate' => 'true',
105 'can_delete' => false,
106 ),
107 'submit' => array(
108 'required' => 'true',
109 'label' => __( 'Submit', 'hustle' ),
110 'error_message' => __( 'Something went wrong, please try again.', 'hustle' ),
111 'name' => 'submit',
112 'type' => 'submit',
113 'placeholder' => __( 'Subscribe', 'hustle' ),
114 'can_delete' => false,
115 ),
116 );
117
118 /**
119 * Filter the form fields that are added by default when creating a new module
120 *
121 * @since 4.2.0
122 */
123 return apply_filters( 'hustle_get_module_default_form_fields', $default_fields );
124 }
125 }
126