| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @version 1.1 |
| 4 | 4 | * @package Booking Calendar |
| @@ -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 | |
| @@ -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 | |
| @@ -233,8 +233,12 @@ | ||
| 233 | 233 | // [dates_count] |
| 234 | 234 | if ( ! in_array( 'dates_count', $skip_shortcodes ) ) { |
| 235 | 235 | /* translators: 1: ... */ |
| 236 | 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') . ')' ) ); | |
| 237 | 241 | } |
| 238 | 242 | |
| 239 | 243 | $fields[] = '<hr/>'; |
| 240 | 244 | |
| @@ -407,10 +411,10 @@ | ||
| 407 | 411 | /* translators: 1: ... */ |
| 408 | 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>'); |
| 409 | 413 | |
| 410 | 414 | |
| 411 | - return $fields; | |
| 412 | -} | |
| 415 | + return (array) apply_filters( 'wpbc_email_help_shortcodes', $fields, $skip_shortcodes, $email_example ); | |
| 416 | +} | |
| 413 | 417 | |
| 414 | 418 | |
| 415 | 419 | function wpbc_email_troubleshooting_help_notice(){ |
| 416 | 420 | |
| @@ -535,23 +539,30 @@ | ||
| 535 | 539 | } |
| 536 | 540 | add_filter( 'wpbc_email_api_get_headers_after', 'wpbc_email_api_get_headers_after', 10, 5 ); // Hook fire in api-email.php |
| 537 | 541 | |
| 538 | 542 | |
| 539 | -/** | |
| 540 | - * Check if we can send Email - block sending in live demos | |
| 541 | - * | |
| 542 | - * @param bool $is_send_email | |
| 543 | - * @param string $email_id | |
| 544 | - * @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 | + * | |
| 545 | 550 | * @return bool |
| 546 | 551 | */ |
| 547 | 552 | function wpbc_email_api_is_allow_send( $is_send_email, $email_id, $fields_values ) { |
| 548 | -//debuge($fields_values); | |
| 549 | - if ( wpbc_is_this_demo() ) | |
| 550 | - $is_send_email = false; | |
| 551 | 553 | |
| 552 | - 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; | |
| 553 | 563 | } |
| 564 | + | |
| 554 | 565 | add_filter( 'wpbc_email_api_is_allow_send', 'wpbc_email_api_is_allow_send', 10, 3 ); // Hook fire in api-email.php |
| 555 | 566 | |
| 556 | 567 | |
| 557 | 568 | /** |
| @@ -591,5 +602,5 @@ | ||
| 591 | 602 | // Error that have no description. Its can be Empty Object like this: WP_Error Object( 'errors' => array(), 'error_data' => array() ), or NOT |
| 592 | 603 | // debuge( $wp_error_object ); |
| 593 | 604 | } |
| 594 | 605 | } |
| 595 | -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); | |