Merged in feature/280-dev-dev01 (pull request #21)
auto-patch 280-dev-dev01-2024-01-19T16_41_58 * auto-patch 280-dev-dev01-2024-01-19T16_41_58
This commit is contained in:
@@ -212,8 +212,12 @@ function wpcf7_validate_configuration() {
|
||||
/**
|
||||
* Returns true if wpcf7_autop() is applied.
|
||||
*/
|
||||
function wpcf7_autop_or_not() {
|
||||
return (bool) apply_filters( 'wpcf7_autop_or_not', WPCF7_AUTOP );
|
||||
function wpcf7_autop_or_not( $options = '' ) {
|
||||
$options = wp_parse_args( $options, array(
|
||||
'for' => 'form',
|
||||
) );
|
||||
|
||||
return (bool) apply_filters( 'wpcf7_autop_or_not', WPCF7_AUTOP, $options );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ add_filter( 'wpcf7_mail_html_body', 'wpcf7_mail_html_body_autop', 10, 1 );
|
||||
* Filter callback that applies auto-p to HTML email message body.
|
||||
*/
|
||||
function wpcf7_mail_html_body_autop( $body ) {
|
||||
if ( wpcf7_autop_or_not() ) {
|
||||
if ( wpcf7_autop_or_not( array( 'for' => 'mail' ) ) ) {
|
||||
$body = wpcf7_autop( $body );
|
||||
}
|
||||
|
||||
|
||||
@@ -68,6 +68,14 @@ class WPCF7_Submission {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
public function __destruct() {
|
||||
$this->remove_uploaded_files();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The main logic of submission.
|
||||
*/
|
||||
@@ -124,8 +132,6 @@ class WPCF7_Submission {
|
||||
do_action( 'wpcf7_mail_failed', $contact_form );
|
||||
}
|
||||
}
|
||||
|
||||
$this->remove_uploaded_files();
|
||||
};
|
||||
|
||||
wpcf7_switch_locale( $this->contact_form->locale(), $callback );
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Contact Form 7 WordPress Plugin, 2007-2023 Takayuki Miyoshi
|
||||
Contact Form 7 WordPress Plugin, 2007-2024 Takayuki Miyoshi
|
||||
Contact Form 7 is distributed under the terms of the GNU GPL
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -102,7 +102,7 @@ function wpcf7_sendinblue_editor_panels( $panels ) {
|
||||
)
|
||||
);
|
||||
|
||||
$lists = $service->get_lists();
|
||||
$lists = wpcf7_sendinblue_get_lists();
|
||||
$templates = $service->get_templates();
|
||||
|
||||
?>
|
||||
@@ -301,3 +301,39 @@ function wpcf7_sendinblue_editor_panels( $panels ) {
|
||||
|
||||
return $panels;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves contact lists from Brevo's database.
|
||||
*/
|
||||
function wpcf7_sendinblue_get_lists() {
|
||||
static $lists = array();
|
||||
|
||||
$service = WPCF7_Sendinblue::get_instance();
|
||||
|
||||
if ( ! empty( $lists ) or ! $service->is_active() ) {
|
||||
return $lists;
|
||||
}
|
||||
|
||||
$limit = 50;
|
||||
$offset = 0;
|
||||
|
||||
while ( count( $lists ) < $limit * 10 ) {
|
||||
$lists_next = (array) $service->get_lists( array(
|
||||
'limit' => $limit,
|
||||
'offset' => $offset,
|
||||
) );
|
||||
|
||||
if ( ! empty( $lists_next ) ) {
|
||||
$lists = array_merge( $lists, $lists_next );
|
||||
}
|
||||
|
||||
if ( count( $lists_next ) < $limit ) {
|
||||
break;
|
||||
}
|
||||
|
||||
$offset += $limit;
|
||||
}
|
||||
|
||||
return $lists;
|
||||
}
|
||||
|
||||
@@ -252,12 +252,14 @@ trait WPCF7_Sendinblue_API {
|
||||
}
|
||||
|
||||
|
||||
public function get_lists() {
|
||||
public function get_lists( $options = '' ) {
|
||||
$options = wp_parse_args( $options, array(
|
||||
'limit' => 50,
|
||||
'offset' => 0,
|
||||
) );
|
||||
|
||||
$endpoint = add_query_arg(
|
||||
array(
|
||||
'limit' => 50,
|
||||
'offset' => 0,
|
||||
),
|
||||
$options,
|
||||
'https://api.sendinblue.com/v3/contacts/lists'
|
||||
);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, mult
|
||||
Requires at least: 6.2
|
||||
Requires PHP: 7.4
|
||||
Tested up to: 6.4
|
||||
Stable tag: 5.8.5
|
||||
Stable tag: 5.8.6
|
||||
License: GPLv2 or later
|
||||
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
@@ -78,6 +78,10 @@ Do you have questions or issues with Contact Form 7? Use these support channels
|
||||
|
||||
For more information, see [Releases](https://contactform7.com/category/releases/).
|
||||
|
||||
= 5.8.6 =
|
||||
|
||||
[https://contactform7.com/contact-form-7-586/](https://contactform7.com/contact-form-7-586/)
|
||||
|
||||
= 5.8.5 =
|
||||
|
||||
[https://contactform7.com/contact-form-7-585/](https://contactform7.com/contact-form-7-585/)
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
* Author URI: https://ideasilo.wordpress.com/
|
||||
* License: GPL v2 or later
|
||||
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
* Version: 5.8.5
|
||||
* Version: 5.8.6
|
||||
* Requires at least: 6.2
|
||||
* Requires PHP: 7.4
|
||||
*/
|
||||
|
||||
define( 'WPCF7_VERSION', '5.8.5' );
|
||||
define( 'WPCF7_VERSION', '5.8.6' );
|
||||
|
||||
define( 'WPCF7_REQUIRED_WP_VERSION', '6.2' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user