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 3.9 3.9-beta 3.9.1 3.9.2 3.9.3 4.0 4.0.1 4.0.2 4.0.3 4.1 4.1-beta 4.1.1 4.1.2 4.2 4.2-beta 4.2.1 4.2.2 4.3 4.3.1 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6 4.6.1 4.7 4.8 4.8.1 4.9 4.9.1 4.9.2 5.0 5.0.1
contact-form-7 / includes / contact-form-template.php
contact-form-7 / includes Last commit date
block-editor 1 year ago config-validator 1 year ago css 1 month ago js 1 year ago swv 10 months ago capabilities.php 7 years ago contact-form-functions.php 1 year ago contact-form-template.php 1 year ago contact-form.php 1 year ago controller.php 1 year ago file.php 10 months ago filesystem.php 1 year ago form-tag.php 7 months ago form-tags-manager.php 1 year ago formatting.php 1 year ago functions.php 10 months ago html-formatter.php 10 months ago integration.php 1 year ago l10n.php 1 year ago mail-tag.php 1 year ago mail.php 4 months ago pipe.php 1 year ago pocket-holder.php 3 years ago rest-api.php 1 year ago shortcodes.php 1 year ago special-mail-tags.php 10 months ago submission.php 10 months ago upgrade.php 1 year ago validation-functions.php 1 year ago validation.php 1 year ago
contact-form-template.php
205 lines
1 <?php
2
3 class WPCF7_ContactFormTemplate {
4
5 public static function get_default( $prop = 'form' ) {
6 if ( 'form' === $prop ) {
7 $template = self::form();
8 } elseif ( 'mail' === $prop ) {
9 $template = self::mail();
10 } elseif ( 'mail_2' === $prop ) {
11 $template = self::mail_2();
12 } elseif ( 'messages' === $prop ) {
13 $template = self::messages();
14 } else {
15 $template = null;
16 }
17
18 return apply_filters( 'wpcf7_default_template', $template, $prop );
19 }
20
21 public static function form() {
22 $template = sprintf(
23 '
24 <label> %2$s
25 [text* your-name autocomplete:name] </label>
26
27 <label> %3$s
28 [email* your-email autocomplete:email] </label>
29
30 <label> %4$s
31 [text* your-subject] </label>
32
33 <label> %5$s %1$s
34 [textarea your-message] </label>
35
36 [submit "%6$s"]',
37 __( '(optional)', 'contact-form-7' ),
38 __( 'Your name', 'contact-form-7' ),
39 __( 'Your email', 'contact-form-7' ),
40 __( 'Subject', 'contact-form-7' ),
41 __( 'Your message', 'contact-form-7' ),
42 __( 'Submit', 'contact-form-7' )
43 );
44
45 return trim( $template );
46 }
47
48 public static function mail() {
49 $template = array(
50 'subject' => sprintf(
51 /* translators: 1: blog name, 2: [your-subject] */
52 _x( '%1$s "%2$s"', 'mail subject', 'contact-form-7' ),
53 '[_site_title]',
54 '[your-subject]'
55 ),
56 'sender' => sprintf(
57 '%s <%s>',
58 '[_site_title]',
59 self::from_email()
60 ),
61 'body' =>
62 sprintf(
63 /* translators: %s: [your-name] [your-email] */
64 __( 'From: %s', 'contact-form-7' ),
65 '[your-name] [your-email]'
66 ) . "\n"
67 . sprintf(
68 /* translators: %s: [your-subject] */
69 __( 'Subject: %s', 'contact-form-7' ),
70 '[your-subject]'
71 ) . "\n\n"
72 . __( 'Message Body:', 'contact-form-7' )
73 . "\n" . '[your-message]' . "\n\n"
74 . '-- ' . "\n"
75 . sprintf(
76 /* translators: 1: blog name, 2: blog URL */
77 __( 'This is a notification that a contact form was submitted on your website (%1$s %2$s).', 'contact-form-7' ),
78 '[_site_title]',
79 '[_site_url]'
80 ),
81 'recipient' => '[_site_admin_email]',
82 'additional_headers' => 'Reply-To: [your-email]',
83 'attachments' => '',
84 'use_html' => 0,
85 'exclude_blank' => 0,
86 );
87
88 return $template;
89 }
90
91 public static function mail_2() {
92 $template = array(
93 'active' => false,
94 'subject' => sprintf(
95 /* translators: 1: blog name, 2: [your-subject] */
96 _x( '%1$s "%2$s"', 'mail subject', 'contact-form-7' ),
97 '[_site_title]',
98 '[your-subject]'
99 ),
100 'sender' => sprintf(
101 '%s <%s>',
102 '[_site_title]',
103 self::from_email()
104 ),
105 'body' =>
106 __( 'Message Body:', 'contact-form-7' )
107 . "\n" . '[your-message]' . "\n\n"
108 . '-- ' . "\n"
109 . sprintf(
110 /* translators: 1: blog name, 2: blog URL */
111 __( 'This email is a receipt for your contact form submission on our website (%1$s %2$s) in which your email address was used. If that was not you, please ignore this message.', 'contact-form-7' ),
112 '[_site_title]',
113 '[_site_url]'
114 ),
115 'recipient' => '[your-email]',
116 'additional_headers' => sprintf(
117 'Reply-To: %s',
118 '[_site_admin_email]'
119 ),
120 'attachments' => '',
121 'use_html' => 0,
122 'exclude_blank' => 0,
123 );
124
125 return $template;
126 }
127
128 public static function from_email() {
129 $admin_email = get_option( 'admin_email' );
130
131 if ( wpcf7_is_localhost() ) {
132 return $admin_email;
133 }
134
135 $sitename = wp_parse_url( network_home_url(), PHP_URL_HOST );
136 $sitename = strtolower( $sitename );
137
138 if ( 'www.' === substr( $sitename, 0, 4 ) ) {
139 $sitename = substr( $sitename, 4 );
140 }
141
142 if ( strpbrk( $admin_email, '@' ) === '@' . $sitename ) {
143 return $admin_email;
144 }
145
146 return 'wordpress@' . $sitename;
147 }
148
149 public static function messages() {
150 $messages = array();
151
152 foreach ( wpcf7_messages() as $key => $arr ) {
153 $messages[$key] = $arr['default'];
154 }
155
156 return $messages;
157 }
158 }
159
160 function wpcf7_messages() {
161 $messages = array(
162 'mail_sent_ok' => array(
163 'description' => __( 'Sender&#8217;s message was sent successfully', 'contact-form-7' ),
164 'default' => __( 'Thank you for your message. It has been sent.', 'contact-form-7' ),
165 ),
166
167 'mail_sent_ng' => array(
168 'description' => __( 'Sender&#8217;s message failed to send', 'contact-form-7' ),
169 'default' => __( 'There was an error trying to send your message. Please try again later.', 'contact-form-7' ),
170 ),
171
172 'validation_error' => array(
173 'description' => __( 'Validation errors occurred', 'contact-form-7' ),
174 'default' => __( 'One or more fields have an error. Please check and try again.', 'contact-form-7' ),
175 ),
176
177 'spam' => array(
178 'description' => __( 'Submission was referred to as spam', 'contact-form-7' ),
179 'default' => __( 'There was an error trying to send your message. Please try again later.', 'contact-form-7' ),
180 ),
181
182 'accept_terms' => array(
183 'description' => __( 'There are terms that the sender must accept', 'contact-form-7' ),
184 'default' => __( 'You must accept the terms and conditions before sending your message.', 'contact-form-7' ),
185 ),
186
187 'invalid_required' => array(
188 'description' => __( 'There is a field that the sender must fill in', 'contact-form-7' ),
189 'default' => __( 'Please fill out this field.', 'contact-form-7' ),
190 ),
191
192 'invalid_too_long' => array(
193 'description' => __( 'There is a field with input that is longer than the maximum allowed length', 'contact-form-7' ),
194 'default' => __( 'This field has a too long input.', 'contact-form-7' ),
195 ),
196
197 'invalid_too_short' => array(
198 'description' => __( 'There is a field with input that is shorter than the minimum allowed length', 'contact-form-7' ),
199 'default' => __( 'This field has a too short input.', 'contact-form-7' ),
200 ),
201 );
202
203 return apply_filters( 'wpcf7_messages', $messages );
204 }
205