PluginProbe
Booking Calendar / 11.8.4
Booking Calendar v11.8.4
11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 All 204 releases
← All changes | core/wpbc-emails.php +199 -99 10.1.311.8.4 View file →
@@ -1,4 +1,4 @@
1 1 <?php
2 2 /**
3 3 * @version 1.1
4 4 * @package Booking Calendar
@@ -43,9 +43,9 @@
43 43 $recipient = $matches[2];
44 44 }
45 45 } else {
46 46 // Check about correct format of email
47 - if( preg_match( '/([\w\.\-_]+)?\w+@[\w\-_]+(\.\w+){1,}/im', $recipient, $matches ) ) { //FixIn: 8.7.7.2
47 + if( preg_match( '/([\w\.\-_]+)?\w+@[\w\-_]+(\.\w+){1,}/im', $recipient, $matches ) ) { // FixIn: 8.7.7.2.
48 48 $recipient = $matches[0];
49 49 }
50 50 }
51 51
@@ -101,11 +101,11 @@
101 101
102 102 $wpbc_email_return_path = new wpbc_email_return_path();
103 103
104 104 // $mail_recipient = str_replace( '"', '', $mail_recipient ); //FixIn:5.4.3
105 - if ( ! wpbc_is_this_demo() ) //FixIn:6.1.1.19
106 - @wp_mail($mail_recipient, $mail_subject, $mail_body, $mail_headers);
107 -
105 + if ( wpbc_email_api_is_allow_send( true, '', '' ) ) {
106 + @wp_mail( $mail_recipient, $mail_subject, $mail_body, $mail_headers );
107 + }
108 108 unset( $wpbc_email_return_path );
109 109 }
110 110
111 111
@@ -111,9 +111,9 @@
111 111
112 112
113 113
114 114
115 -function wpbc_check_for_several_emails_in_form( $mail_recipients, $formdata, $bktype ) { //FixIn: 6.0.1.9
115 +function wpbc_check_for_several_emails_in_form( $mail_recipients, $formdata, $bktype ) { // FixIn: 6.0.1.9.
116 116
117 117 $possible_other_emails = explode('~',$formdata);
118 118 $possible_other_emails = array_map("explode", array_fill(0,count($possible_other_emails),'^'), $possible_other_emails);
119 119 $other_emails = array();
@@ -121,11 +121,11 @@
121 121 if ( ( $possible_emails[0] == 'email' )
122 122 //&& ( $possible_emails[1] != 'email' . $bktype )
123 123 && ( ! empty($possible_emails[2]) )
124 124 )
125 - $other_emails[]= trim( $possible_emails[2] ); //FixIn: 8.2.1.6
125 + $other_emails[]= trim( $possible_emails[2] ); // FixIn: 8.2.1.6.
126 126 }
127 - $other_emails = array_unique( $other_emails ); //FixIn: 8.2.1.6
127 + $other_emails = array_unique( $other_emails ); // FixIn: 8.2.1.6.
128 128 if ( count( $other_emails ) > 1 ) {
129 129 $other_emails = implode(',',$other_emails);
130 130 $mail_recipients = $other_emails;
131 131 }
@@ -156,9 +156,9 @@
156 156 $pure_name = $matches[1];
157 157 $pure_email = $matches[2];
158 158 }
159 159 } else { // Check about correct format of email
160 - if( preg_match( '/([\w\.\-_]+)?\w+@[\w-_]+(\.\w+){1,}/im', $email_to_parse, $matches ) ) {
160 + if( preg_match( '/([\w\.\-_]+)?\w+@[\w\-_]+(\.\w+){1,}/im', $email_to_parse, $matches ) ) {
161 161 $pure_email = $matches[0];
162 162 }
163 163 }
164 164
@@ -174,11 +174,22 @@
174 174 return $return_email;
175 175 }
176 176
177 177
178 + function wpbc_tooltip_help__fix_quote( $field_val ) {
179 +
180 + $field_val = str_replace( '"', "'", $field_val );
181 +
182 + return $field_val;
183 + }
184 +
178 185 // Get Emails Help Shortcodes for Settings pages
179 186 function wpbc_get_email_help_shortcodes( $skip_shortcodes = array() , $email_example = '') {
180 -
187 +
188 + $icn = '<a href="https://wpbookingcalendar.com/faq/email-shortcodes/#available_shortcodes"
189 + class="tooltip_top wpbc-bi-question-circle wpbc_help_tooltip_icon_left"
190 + data-original-title="%2$s"></a> %1$s';
191 +
181 192 $fields = array();
182 193
183 194 if ( class_exists('wpdev_bk_personal') ) {
184 195 $fields[] = sprintf(__('You can use (in subject and content of email template) any shortcodes, which you used in the booking form. Use the shortcodes in the same way as you used them in the content form at Settings Fields page.' ,'booking'));
@@ -183,101 +194,157 @@
183 194 if ( class_exists('wpdev_bk_personal') ) {
184 195 $fields[] = sprintf(__('You can use (in subject and content of email template) any shortcodes, which you used in the booking form. Use the shortcodes in the same way as you used them in the content form at Settings Fields page.' ,'booking'));
185 196 $fields[] = '<hr/>';
186 197 }
187 - $fields[] = '<strong>' . __('You can use following shortcodes in content of this template' ,'booking') . '</strong>';
198 + $fields[] = '<strong>' . esc_html__('You can use following shortcodes in content of this template' ,'booking') . '</strong>';
188 199
189 200 // [content]
190 - if ( class_exists('wpdev_bk_personal') )
191 - $fields[] = sprintf(__('%s - inserting data info about the booking, which you configured in the content form at Settings Fields page' ,'booking'),'<code>[content]</code>');
192 - else
193 - $fields[] = sprintf(__('%s - inserting data info about the booking' ,'booking'),'<code>[content]</code>');
201 + if ( class_exists( 'wpdev_bk_personal' ) ) {
202 + /* translators: 1: ... */
203 + $fields[] = sprintf( $icn, '<code>[content]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting data info about the booking, which you configured in the content form at Settings Fields page', 'booking' ), '[content]' ) ) );
204 + } else {
205 + /* translators: 1: ... */
206 + $fields[] = sprintf( $icn, '<code>[content]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting data info about the booking', 'booking' ), '[content]' ) ) );
207 + }
194 208
195 209
196 210 // [dates]
197 - $fields[] = sprintf(__('%s - inserting the dates of booking' ,'booking'),'<code>[dates]</code>');
198 -
211 + /* translators: 1: ... */
212 + $fields[] = sprintf( $icn, '<code>[dates]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting the dates of booking' ,'booking'), '[dates]' ) ) );
213 + /* translators: 1: ... */
214 + $fields[] = sprintf( $icn, '<code>[only_dates]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting only booking dates without times' ,'booking'), '[only_dates]' ) ) );
215 +
199 216 // [check_in_date]
200 217 if ( ! in_array( 'check_in_date', $skip_shortcodes ) ) {
201 - $fields[] = sprintf( __( '%s - inserting check-in date (first day of reservation),', 'booking' ), '<code>[check_in_date]</code>' );
202 - $fields[] = sprintf( __( '%s - inserting check-in date (only date without time) (first day of reservation),', 'booking' ), '<code>[check_in_only_date]</code>' ); //FixIn: 8.7.2.5
218 + /* translators: 1: ... */
219 + $fields[] = sprintf( $icn, '<code>[check_in_date]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting check-in date (first day of reservation),', 'booking' ), '[check_in_date]' ) ) );
220 + /* translators: 1: ... */
221 + $fields[] = sprintf( $icn, '<code>[check_in_only_date]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting check-in date (only date without time) (first day of reservation),', 'booking' ), '[check_in_only_date]' ) ) ); // FixIn: 8.7.2.5.
203 222 }
204 223 // [check_out_date] [check_out_plus1day]
205 224 if ( ! in_array( 'check_out_date', $skip_shortcodes ) ) {
206 - $fields[] = sprintf(__('%s - inserting check-out date (last day of reservation),' ,'booking'),'<code>[check_out_date]</code>');
207 - $fields[] = sprintf(__('%s - inserting check-out date (only date without time) (last day of reservation),' ,'booking'),'<code>[check_out_only_date]</code>'); //FixIn: 8.7.2.5
208 - $fields[] = sprintf(__('%s - inserting check-out date (last day of reservation),' ,'booking'),'<code>[check_out_plus1day]</code>') . ' + 1 ' . __('day', 'booking');
225 + /* translators: 1: ... */
226 + $fields[] = sprintf( $icn, '<code>[check_out_date]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting check-out date (last day of reservation),' ,'booking'), '[check_out_date]' ) ) );
227 + /* translators: 1: ... */
228 + $fields[] = sprintf( $icn, '<code>[check_out_only_date]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting check-out date (only date without time) (last day of reservation),' ,'booking'), '[check_out_only_date]' ) ) ); // FixIn: 8.7.2.5.
229 + /* translators: 1: ... */
230 + $fields[] = sprintf( $icn, '<code>[check_out_plus1day]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting check-out date (last day of reservation),' ,'booking'), '[check_out_plus1day]') . ' + 1 ' . __('day', 'booking') ) );
209 231 }
210 232
211 233 // [dates_count]
212 - if ( ! in_array( 'dates_count', $skip_shortcodes ) )
213 - $fields[] = sprintf(__('%s - inserting the number of booking dates ' ,'booking'),'<code>[dates_count]</code>');
214 -
234 + if ( ! in_array( 'dates_count', $skip_shortcodes ) ) {
235 + /* translators: 1: ... */
236 + $fields[] = sprintf( $icn, '<code>[dates_count]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting the number of booking dates ', 'booking' ), '[dates_count]' ) ) );
237 +
238 + $fields[] = sprintf( $icn, '<code>[days_count]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( 'Number of selected days.', 'booking' ), '[days_count]' ) ) );
239 + $fields[] = sprintf( $icn, '<code>[nights_count]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( 'Number of selected nights.', 'booking' ), '[nights_count]' ) ) );
240 + $fields[] = sprintf( $icn, '<code>[days_count_plus1day]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( 'Number of selected days.', 'booking' ), '[days_count_plus1day]' ) . ' (+ 1 ' . __('day', 'booking') . ')' ) );
241 + }
242 +
215 243 $fields[] = '<hr/>';
216 244
217 245
218 246 // [id]
219 - $fields[] = sprintf(__('%s - inserting ID of booking ' ,'booking'),'<code>[id]</code>');
247 + /* translators: 1: ... */
248 + $fields[] = sprintf( $icn, '<code>[booking_id]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting ID of booking ' ,'booking'), '[id], [booking_id]' ) ) );
220 249
221 250 // [resource_title] [bookingtype]
222 - if ( class_exists('wpdev_bk_personal') )
223 - if ( ! in_array( 'bookingtype', $skip_shortcodes ) )
224 - $fields[] = sprintf(__('%s or %s - inserting the title of the booking resource ' ,'booking'),'<code>[resource_title]</code>','<code>[bookingtype]</code>');
225 -
251 + if ( class_exists( 'wpdev_bk_personal' ) ) {
252 + if ( ! in_array( 'bookingtype', $skip_shortcodes ) ) {
253 + /* translators: 1: ... */
254 + $fields[] = sprintf( $icn, '<code>[resource_title]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%1$s or %2$s - inserting the title of the booking resource ', 'booking' ), '[resource_title]', '[bookingtype]' ) ) );
255 + }
256 + }
257 + // FixIn: 10.9.2.4.
258 + if ( class_exists( 'wpdev_bk_biz_l' ) ) {
259 + if ( ! in_array( 'bookingtype', $skip_shortcodes ) ) {
260 + /* translators: 1: ... */
261 + $fields[] = sprintf( $icn, '<code>[parent_resource_title]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting the title of the parent booking resource ', 'booking' ), '[parent_resource_title]' ) ) );
262 + }
263 + }
264 +
226 265
227 266 // [cost]
228 - if ( class_exists('wpdev_bk_biz_s') )
229 - if ( ! in_array( 'cost', $skip_shortcodes ) )
230 - $fields[] = sprintf(__('%s - inserting the cost of booking ' ,'booking'),'<code>[cost]</code>');
267 + if ( class_exists( 'wpdev_bk_biz_s' ) ) {
268 + if ( ! in_array( 'cost', $skip_shortcodes ) ) {
269 + /* translators: 1: ... */
270 + $fields[] = sprintf( $icn, '<code>[cost]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting the cost of booking ', 'booking' ), '[cost]' ) ) );
271 + }
272 + }
231 273
232 274 $fields[] = '<hr/>';
233 -
234 -
275 +
235 276 // [siteurl]
236 - $fields[] = sprintf(__('%s - inserting your site URL ' ,'booking'),'<code>[siteurl]</code>');
277 + /* translators: 1: ... */
278 + $fields[] = sprintf( $icn, '<code>[siteurl]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting your site URL ' ,'booking'), '[siteurl]' ) ) );
237 279
238 280 if ( class_exists('wpdev_bk_personal') ) {
239 - $fields[] = sprintf(__('%s - inserting IP address of the user who made this action ' ,'booking'),'<code>[remote_ip]</code>');
240 - $fields[] = sprintf(__('%s - inserting contents of the User-Agent: header from the current request, if there is one ' ,'booking'),'<code>[user_agent]</code>');
241 - $fields[] = sprintf(__('%s - inserting address of the page (if any), where visitor make this action ' ,'booking'),'<code>[request_url]</code>');
242 - $fields[] = sprintf(__('%s - inserting time of this action ' ,'booking'),'<code>[current_time]</code>');
281 + /* translators: 1: ... */
282 + $fields[] = sprintf( $icn, '<code>[remote_ip]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting IP address of the user who made this action ' ,'booking'), '[remote_ip]' ) ) );
283 + /* translators: 1: ... */
284 + $fields[] = sprintf( $icn, '<code>[user_agent]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting contents of the User-Agent: header from the current request, if there is one ' ,'booking'), '[user_agent]' ) ) );
285 + /* translators: 1: ... */
286 + $fields[] = sprintf( $icn, '<code>[request_url]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting address of the page (if any), where visitor make this action ' ,'booking'), '[request_url]' ) ) );
287 + /* translators: 1: ... */
288 + $fields[] = sprintf( $icn, '<code>[current_time]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting time of this action ' ,'booking'), '[current_time]' ) ) );
243 289 }
244 290
245 - $fields[] = sprintf(__('%s - inserting date of this action ' ,'booking'),'<code>[current_date]</code>');
291 + /* translators: 1: ... */
292 + $fields[] = sprintf( $icn, '<code>[current_date]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting date of this action ' ,'booking'), '[current_date]' ) ) );
246 293
247 - $fields[] = sprintf(__('%s - inserting modification date of booking ' ,'booking'),'<code>[modification_date]</code>');
248 - $fields[] = sprintf(__('%s - inserting modification date of booking ' ,'booking'),'<code>[modification_year]</code>');
249 - $fields[] = sprintf(__('%s - inserting modification date of booking ' ,'booking'),'<code>[modification_month]</code>');
250 - $fields[] = sprintf(__('%s - inserting modification date of booking ' ,'booking'),'<code>[modification_day]</code>');
251 - $fields[] = sprintf(__('%s - inserting modification date of booking ' ,'booking'),'<code>[modification_hour]</code>');
252 - $fields[] = sprintf(__('%s - inserting modification date of booking ' ,'booking'),'<code>[modification_minutes]</code>');
253 - $fields[] = sprintf(__('%s - inserting modification date of booking ' ,'booking'),'<code>[modification_seconds]</code>');
254 - //FixIn: 10.0.0.34
255 - $fields[] = sprintf(__('%s - inserting creation date of booking ' ,'booking'),'<code>[creation_date]</code>');
256 - $fields[] = sprintf(__('%s - inserting creation date of booking ' ,'booking'),'<code>[creation_year]</code>');
257 - $fields[] = sprintf(__('%s - inserting creation date of booking ' ,'booking'),'<code>[creation_month]</code>');
258 - $fields[] = sprintf(__('%s - inserting creation date of booking ' ,'booking'),'<code>[creation_day]</code>');
259 - $fields[] = sprintf(__('%s - inserting creation date of booking ' ,'booking'),'<code>[creation_hour]</code>');
260 - $fields[] = sprintf(__('%s - inserting creation date of booking ' ,'booking'),'<code>[creation_minutes]</code>');
261 - $fields[] = sprintf(__('%s - inserting creation date of booking ' ,'booking'),'<code>[creation_seconds]</code>');
294 + /* translators: 1: ... */
295 + $fields[] = sprintf( $icn, '<code>[modification_date]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting modification date of booking ' ,'booking'), '[modification_date]' ) ) );
296 + /* translators: 1: ... */
297 + $fields[] = sprintf( $icn, '<code>[modification_year]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting modification date of booking ' ,'booking'), '[modification_year]' ) ) );
298 + /* translators: 1: ... */
299 + $fields[] = sprintf( $icn, '<code>[modification_month]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting modification date of booking ' ,'booking'), '[modification_month]' ) ) );
300 + /* translators: 1: ... */
301 + $fields[] = sprintf( $icn, '<code>[modification_day]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting modification date of booking ' ,'booking'), '[modification_day]' ) ) );
302 + /* translators: 1: ... */
303 + $fields[] = sprintf( $icn, '<code>[modification_hour]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting modification date of booking ' ,'booking'), '[modification_hour]' ) ) );
304 + /* translators: 1: ... */
305 + $fields[] = sprintf( $icn, '<code>[modification_minutes]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting modification date of booking ' ,'booking'), '[modification_minutes]' ) ) );
306 + /* translators: 1: ... */
307 + $fields[] = sprintf( $icn, '<code>[modification_seconds]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting modification date of booking ' ,'booking'), '[modification_seconds]' ) ) );
308 + // FixIn: 10.0.0.34.
309 + /* translators: 1: ... */
310 + $fields[] = sprintf( $icn, '<code>[creation_date]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting creation date of booking ' ,'booking'), '[creation_date]' ) ) );
311 + /* translators: 1: ... */
312 + $fields[] = sprintf( $icn, '<code>[creation_year]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting creation date of booking ' ,'booking'), '[creation_year]' ) ) );
313 + /* translators: 1: ... */
314 + $fields[] = sprintf( $icn, '<code>[creation_month]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting creation date of booking ' ,'booking'), '[creation_month]' ) ) );
315 + /* translators: 1: ... */
316 + $fields[] = sprintf( $icn, '<code>[creation_day]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting creation date of booking ' ,'booking'), '[creation_day]' ) ) );
317 + /* translators: 1: ... */
318 + $fields[] = sprintf( $icn, '<code>[creation_hour]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting creation date of booking ' ,'booking'), '[creation_hour]' ) ) );
319 + /* translators: 1: ... */
320 + $fields[] = sprintf( $icn, '<code>[creation_minutes]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting creation date of booking ' ,'booking'), '[creation_minutes]' ) ) );
321 + /* translators: 1: ... */
322 + $fields[] = sprintf( $icn, '<code>[creation_seconds]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting creation date of booking ' ,'booking'), '[creation_seconds]' ) ) );
262 323
263 324
264 325
265 326 // [moderatelink]
266 327 if ( ! in_array( 'moderatelink', $skip_shortcodes ) ) {
267 - $fields[] = sprintf(__('%s - inserting moderate link of new booking ' ,'booking'),'<code>[moderatelink]</code>');
328 + /* translators: 1: ... */
329 + $fields[] = sprintf( $icn, '<code>[moderatelink]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting moderate link of new booking ' ,'booking'), '[moderatelink]' ) ) );
268 330
269 - //FixIn: 8.4.7.25
270 - $fields[] = sprintf(__('%s - inserting link to approve booking in 1 mouse click ' ,'booking'),'<code>[click2approve]</code>');
271 - $fields[] = sprintf(__('%s - inserting link to set booking as pending in 1 mouse click ' ,'booking'),'<code>[click2decline]</code>');
272 - $fields[] = sprintf(__('%s - inserting link for move booking to trash in 1 mouse click ' ,'booking'),'<code>[click2trash]</code>');
331 + // FixIn: 8.4.7.25.
332 + /* translators: 1: ... */
333 + $fields[] = sprintf( $icn, '<code>[click2approve]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting link to approve booking in 1 mouse click ' ,'booking'), '[click2approve]' ) ) );
334 + /* translators: 1: ... */
335 + $fields[] = sprintf( $icn, '<code>[click2decline]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting link to set booking as pending in 1 mouse click ' ,'booking'), '[click2decline]' ) ) );
336 + /* translators: 1: ... */
337 + $fields[] = sprintf( $icn, '<code>[click2trash]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting link for move booking to trash in 1 mouse click ' ,'booking'), '[click2trash]' ) ) );
273 338
274 339 }
275 340
276 - //FixIn: 9.6.3.8
341 + // FixIn: 9.6.3.8.
277 342 if ( ! in_array( 'add_to_google_cal_button', $skip_shortcodes ) ) {
278 - $fields[] = sprintf(__('%s - inserting link for export booking to' ,'booking'),'<code>[add_to_google_cal_button]</code>') . ' Google Calendar'; //FixIn: 7.1.2.5
279 - $fields[] = sprintf(__('%s - inserting URL for export booking to' ,'booking'),'<code>[add_to_google_cal_url]</code>') . ' Google Calendar'; //FixIn: 7.1.2.5
343 + /* translators: 1: ... */
344 + $fields[] = sprintf( $icn, '<code>[add_to_google_cal_button]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting link for export booking to' ,'booking'), '[add_to_google_cal_button]') . ' Google Calendar' ) );
345 + /* translators: 1: ... */
346 + $fields[] = sprintf( $icn, '<code>[add_to_google_cal_url]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - inserting URL for export booking to' ,'booking'), '[add_to_google_cal_url]') . ' Google Calendar' ) );
280 347
281 348 }
282 349
283 350
@@ -283,32 +350,53 @@
283 350
284 351 if ( class_exists('wpdev_bk_personal') ) {
285 352
286 353 //FixIn: 8.1.3.5.1
287 - if ( ! in_array( 'visitorbookingslisting', $skip_shortcodes ) )
288 - $fields[] = sprintf(__('%s - inserting link to the page where visitor can see listing of own bookings, (possible to use the %s parameter for setting different %s of this page. Example: %s )' ,'booking'),'<code>[visitorbookingslisting]</code>', '"url"', 'URL', '<em>[visitorbookingslisting url="http://www.server.com/custom-page/"]</em>');
354 + if ( ! in_array( 'visitorbookingslisting', $skip_shortcodes ) ) {
355 + /* translators: 1: ... */
356 + $fields[] = sprintf( $icn, '<code>[visitorbookingslisting]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%1$s - inserting link to the page where visitor can see listing of own bookings, (possible to use the %2$s parameter for setting different %3$s of this page. Example: %4$s )', 'booking' ), '[visitorbookingslisting]', '"url"', 'URL', '[visitorbookingslisting url="http://www.server.com/custom-page/"]' )
357 + /* translators: 1: ... */
358 + . ' ' . sprintf( __( 'Example of HTML a link usage: %s )', 'booking' ), '[visitorbookingslisting url="http://www.server.com/listing-custom-page/" type="link" title="Listing"]]' ) ) );
359 + }
289 360
290 - if ( ! in_array( 'visitorbookingediturl', $skip_shortcodes ) )
291 - $fields[] = sprintf(__('%s - inserting link to the page where visitor can edit the reservation, (possible to use the %s parameter for setting different %s of this page. Example: %s )' ,'booking'),'<code>[visitorbookingediturl]</code>', '"url"', 'URL', '<em>[visitorbookingediturl url="http://www.server.com/custom-page/"]</em>');
361 + if ( ! in_array( 'visitorbookingediturl', $skip_shortcodes ) ) {
362 + /* translators: 1: ... */
363 + $fields[] = sprintf( $icn, '<code>[visitorbookingediturl]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%1$s - inserting link to the page where visitor can edit the reservation, (possible to use the %2$s parameter for setting different %3$s of this page. Example: %4$s )', 'booking' ), '[visitorbookingediturl]', '"url"', 'URL', '[visitorbookingediturl url="http://www.server.com/custom-page/"]' )
364 + /* translators: 1: ... */
365 + . ' ' . sprintf( __( 'Example of HTML a link usage: %s )', 'booking' ), '[visitorbookingediturl url="http://www.server.com/edit-custom-page/" type="link" title="Edit Booking"]]' ) ) );
366 + }
367 + // [visitorbookingcancelurl]
368 + if ( ! in_array( 'visitorbookingcancelurl', $skip_shortcodes ) ) {
292 369
293 - // [visitorbookingcancelurl]
294 - if ( ! in_array( 'visitorbookingcancelurl', $skip_shortcodes ) )
295 - $fields[] = sprintf(__('%s - inserting link to the page where visitor can cancel the reservation, (possible to use the %s parameter for setting different %s of this page. Example: %s )' ,'booking'),'<code>[visitorbookingcancelurl]</code>', '"url"', 'URL', '<em>[visitorbookingcancelurl url="http://www.server.com/custom-page/"]</em>');
370 + /* translators: 1: ... */
371 + $fields[] = sprintf( $icn, '<code>[visitorbookingcancelurl]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%1$s - inserting link to the page where visitor can cancel the reservation, (possible to use the %2$s parameter for setting different %3$s of this page. Example: %4$s )', 'booking' ), '[visitorbookingcancelurl]', '"url"', 'URL', '[visitorbookingcancelurl url="http://www.server.com/custom-page/"]' )
372 + /* translators: 1: ... */
373 + . ' ' . sprintf( __( 'Example of HTML a link usage: %s )' ,'booking'), '[visitorbookingcancelurl url="http://www.server.com/cancel-custom-page/" type="link" title="Cancel Booking"]]' )
374 + ) );
375 + }
296 376
297 377 if ( class_exists('wpdev_bk_biz_s') ) {
298 - // [visitorbookingpayurl]
299 - if ( ! in_array( 'visitorbookingpayurl', $skip_shortcodes ) )
300 - $fields[] = sprintf(__('%s - inserting link to payment page where visitor can pay for the reservation (possible to use the %s parameter for setting different %s of this page. Example: %s )' ,'booking'),'<code>[visitorbookingpayurl]</code>', '"url"', 'URL', '<em>[visitorbookingpayurl url="http://www.server.com/custom-page/"]</em>');
301 -
378 + // [visitorbookingpayurl]
379 + if ( ! in_array( 'visitorbookingpayurl', $skip_shortcodes ) ) {
380 + /* translators: 1: ... */
381 + $fields[] = sprintf( $icn, '<code>[visitorbookingpayurl]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%1$s - inserting link to payment page where visitor can pay for the reservation (possible to use the %2$s parameter for setting different %3$s of this page. Example: %4$s )', 'booking' ), '[visitorbookingpayurl]', '"url"', 'URL', '[visitorbookingpayurl url="http://www.server.com/custom-page/"]' )
382 + /* translators: 1: ... */
383 + . ' ' . sprintf( __( 'Example of HTML a link usage: %s )', 'booking' ), '[visitorbookingpayurl url="http://www.server.com/payment-custom-page/" type="link" title="Pay Now"]]' ) ) );
384 + }
385 +
302 386 // [paymentreason]
303 - if ( ! in_array( 'paymentreason', $skip_shortcodes ) )
304 - $fields[] = sprintf(__('%s - add the reason for booking payment, you can enter it before sending email, ' ,'booking'),'<code>[paymentreason]</code>');
387 + if ( ! in_array( 'paymentreason', $skip_shortcodes ) ) {
388 + /* translators: 1: ... */
389 + $fields[] = sprintf( $icn, '<code>[paymentreason]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - add the reason for booking payment, you can enter it before sending email, ', 'booking' ), '[paymentreason]' ) ) );
390 + }
305 391 }
306 392 }
307 393
308 394 // [denyreason]
309 - if ( ! in_array( 'denyreason', $skip_shortcodes ) )
310 - $fields[] = sprintf(__('%s - add the reason booking was cancelled, you can enter it before sending email, ' ,'booking'),'<code>[denyreason]</code>');
395 + if ( ! in_array( 'denyreason', $skip_shortcodes ) ) {
396 + /* translators: 1: ... */
397 + $fields[] = sprintf( $icn, '<code>[denyreason]</code>', wpbc_tooltip_help__fix_quote( sprintf( __( '%s - add the reason booking was cancelled, you can enter it before sending email, ', 'booking' ), '[denyreason]' ) ) );
398 + }
311 399
312 400
313 401 //$fields[] = __('HTML tags is accepted.' ,'booking');
314 402
@@ -315,23 +403,28 @@
315 403 $fields[] = '<hr/>';
316 404
317 405 // show_additional_translation_shortcode_help
318 406 $fields[] = '<strong>' . sprintf(__('Configuration in several languages' ,'booking') ) . '.</strong>';
319 - $fields[] = sprintf(__('%s - start new translation section, where %s - locale of translation' ,'booking'),'<code>[lang=LOCALE]</code>','<code>LOCALE</code>');
320 - $fields[] = sprintf(__('Example #1: %s - start French translation section' ,'booking'),'<code>[lang=fr_FR]</code>');
321 - $fields[] = sprintf(__('Example #2: "%s" - English and French translation of some message' ,'booking'),'<code>Thank you for your booking.[lang=fr_FR]Je vous remercie de votre reservation.</code>');
322 -
407 + /* translators: 1: ... */
408 + $fields[] = sprintf( __( '%1$s - start new translation section, where %2$s - locale of translation', 'booking' ),'<code>[lang=LOCALE]</code>','<code>LOCALE</code>');
409 + /* translators: 1: ... */
410 + $fields[] = sprintf(__( 'Example #1: %s - start French translation section' ,'booking'),'<code>[lang=fr_FR]</code>');
411 + /* translators: 1: ... */
412 + $fields[] = sprintf(__( 'Example #2: "%s" - English and French translation of some message' ,'booking'),'<code>Thank you for your booking.[lang=fr_FR]Je vous remercie de votre reservation.</code>');
323 413
324 - return $fields;
325 -}
326 414
415 + return (array) apply_filters( 'wpbc_email_help_shortcodes', $fields, $skip_shortcodes, $email_example );
416 +}
327 417
418 +
328 419 function wpbc_email_troubleshooting_help_notice(){
329 420
330 421 ?><div class="wpbc-settings-notice notice-warning notice-helpful-info">
331 - <?php printf( __( 'To ensure your notifications arrive in your and your customers inboxes, we recommend connecting your email address to your domain and setting up a dedicated SMTP server. If something does not seem to be sending correctly, install the %s or check the %sEmail FAQ%s page.', 'booking' ),
422 + <?php
423 + /* translators: 1: ... */
424 + echo wp_kses_post( sprintf( __( 'To ensure your notifications arrive in your and your customers inboxes, we recommend connecting your email address to your domain and setting up a dedicated SMTP server. If something does not seem to be sending correctly, install the %1$s or check the %2$sEmail FAQ%3$s page.', 'booking' ),
332 425 '<a href="https://wordpress.org/plugins/wp-mail-logging/">WP Mail Logging Plugin</a>',
333 - '<a href="https://wpbookingcalendar.com/faq/no-emails/">', '</a>' ); ?>
426 + '<a href="https://wpbookingcalendar.com/faq/no-emails/">', '</a>' ) ); ?>
334 427 </div><?php
335 428 }
336 429
337 430
@@ -425,9 +518,9 @@
425 518 if (
426 519 ( $email_id == 'new_admin' ) // Only for email: "New Booking to Admin"
427 520 || ( isset( $additional_params['reply'] ) )
428 521 ){
429 - //FixIn: 9.7.3.17
522 + // FixIn: 9.7.3.17.
430 523 if (
431 524 ( ! empty( $replace_array['email'] ) )
432 525 && ( ! empty( $fields_values['enable_replyto'] ) )
433 526 && ( 'On' == $fields_values['enable_replyto'] )
@@ -446,23 +539,30 @@
446 539 }
447 540 add_filter( 'wpbc_email_api_get_headers_after', 'wpbc_email_api_get_headers_after', 10, 5 ); // Hook fire in api-email.php
448 541
449 542
450 -/**
451 - * Check if we can send Email - block sending in live demos
452 - *
453 - * @param bool $is_send_email
454 - * @param string $email_id
455 - * @param array $fields_values - list of params to parse: 'content', 'header_content', 'footer_content' for different languges, etc ....
543 +/**
544 + * Check if we can send Email - block sending in live demos
545 + *
546 + * @param bool $is_send_email - is send emails?.
547 + * @param string $email_id - email id.
548 + * @param array $fields_values - list of params to parse: 'content', 'header_content', 'footer_content' for different languges, etc ....
549 + *
456 550 * @return bool
457 551 */
458 552 function wpbc_email_api_is_allow_send( $is_send_email, $email_id, $fields_values ) {
459 -//debuge($fields_values);
460 - if ( wpbc_is_this_demo() )
461 - $is_send_email = false;
462 553
463 - return $is_send_email;
554 + if ( wpbc_is_this_demo() ) {
555 + $is_send_email = false;
556 + }
557 + // FixIn: 10.12.1.5.
558 + if ( WPBC_IS_PLAYGROUND ) {
559 + $is_send_email = false;
560 + }
561 +
562 + return $is_send_email;
464 563 }
564 +
465 565 add_filter( 'wpbc_email_api_is_allow_send', 'wpbc_email_api_is_allow_send', 10, 3 ); // Hook fire in api-email.php
466 566
467 567
468 568 /**
@@ -472,9 +572,9 @@
472 572 * @param string $error_description - Description
473 573 */
474 574 function wpbc_email_sending_error( $wp_error_object, $error_description = '' ) {
475 575
476 - if ( ( defined( 'WPBC_AJAX_ERROR_CATCH' ) ) && ( WPBC_AJAX_ERROR_CATCH ) ) { return false; } //FixIn: 9.2.1.10
576 + if ( ( defined( 'WPBC_AJAX_ERROR_CATCH' ) ) && ( WPBC_AJAX_ERROR_CATCH ) ) { return false; } // FixIn: 9.2.1.10.
477 577
478 578 if ( empty( $error_description ) ) {
479 579 // $error_description = __( 'Unknown exception', 'booking' ) . '.'; // Overwrite to show error, if no description ???
480 580 }
@@ -502,5 +602,5 @@
502 602 // Error that have no description. Its can be Empty Object like this: WP_Error Object( 'errors' => array(), 'error_data' => array() ), or NOT
503 603 // debuge( $wp_error_object );
504 604 }
505 605 }
506 -add_action('wpbc_email_sending_error', 'wpbc_email_sending_error', 10, 2);
606 +add_action('wpbc_email_sending_error', 'wpbc_email_sending_error', 10, 2);