Skip to content

Commit 9318a8b

Browse files
release: v.2.3.4
- Fix z-index with Shape Divider in Section - Fix Tabs Block Resetting Editor Sidebar When Changing Viewport - Fix Fatal Error in Form Submission Page in Certain Cases If Viewed as Super Admin - Fix Progress Bar Height for Mobile Devices - Fix Stripe Block Not Working Correctly in WP 5.9 - Fix Form Submit Messages Not Working
2 parents 7fcc6d0 + 0adae93 commit 9318a8b

File tree

39 files changed

+1656
-1014
lines changed

39 files changed

+1656
-1014
lines changed

composer.lock

Lines changed: 25 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inc/integrations/api/form-response-data.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ class Form_Data_Response {
8383
* @since 2.0.0
8484
*/
8585
public function __construct() {
86-
$this->response['success'] = false;
87-
$this->response['reasons'] = array();
88-
$this->response['code'] = self::SUCCESS_EMAIL_SEND;
89-
$this->response['displayError'] = 'Error. Please try again.';
86+
$this->response['success'] = false;
87+
$this->response['reasons'] = array();
88+
$this->response['code'] = self::SUCCESS_EMAIL_SEND;
89+
$this->response['displayError'] = 'Error. Please try again.';
90+
$this->response['submitMessage'] = 'Success';
9091
}
9192

9293
/**
@@ -148,6 +149,17 @@ public function set_reasons( $reasons ) {
148149
return $this;
149150
}
150151

152+
/**
153+
* Set success message.
154+
*
155+
* @param string $message The message.
156+
* @since 2.4
157+
*/
158+
public function set_success_message( $message ) {
159+
$this->response['submitMessage'] = $message;
160+
return $this;
161+
}
162+
151163
/**
152164
* Check if success.
153165
*

inc/plugins/class-dashboard.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ private function the_otter_banner() {
253253
.otter-banner__version {
254254
align-self: center;
255255
}
256+
257+
/* Hide the "Add New" button for Multisite WP. Second part is for Elementor */
258+
a.page-title-action:first-of-type, #e-admin-top-bar-root:not(.e-admin-top-bar--active)~#wpbody .wrap a.page-title-action:first-of-type {
259+
display: none;
260+
}
256261
</style>
257262
<div class="otter-banner">
258263
<div class="otter-banner__image">

inc/server/class-form-server.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -278,20 +278,22 @@ public function frontend( $request ) {
278278
do_action( 'otter_form_after_submit', $form_data );
279279

280280
if ( ! ( $form_data instanceof Form_Data_Request ) ) {
281-
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR );
282-
$res->add_reason( __( 'The form data class is not valid after performing provider actions! Some hook is corrupting the data.', 'otter-blocks' ) );
281+
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR )
282+
->add_reason( __( 'The form data class is not valid after performing provider actions! Some hook is corrupting the data.', 'otter-blocks' ) );
283283
}
284284

285285
if ( $form_data->has_error() ) {
286-
$res->set_code( $form_data->get_error_code() );
286+
$res->set_code( $form_data->get_error_code() )
287+
->set_display_error( $form_options->get_error_message() );
287288
} else {
288-
$res->set_code( Form_Data_Response::SUCCESS_EMAIL_SEND );
289-
$res->mark_as_success();
289+
$res->set_code( Form_Data_Response::SUCCESS_EMAIL_SEND )
290+
->set_success_message( $form_options->get_submit_message() )
291+
->mark_as_success();
290292
}
291293
}
292294
} catch ( Exception $e ) {
293-
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR );
294-
$res->add_reason( $e->getMessage() );
295+
$res->set_code( Form_Data_Response::ERROR_RUNTIME_ERROR )
296+
->add_reason( $e->getMessage() );
295297
$form_data->set_error( Form_Data_Response::ERROR_RUNTIME_ERROR, $e->getMessage() );
296298
$this->send_error_email( $form_data );
297299
} finally {

0 commit comments

Comments
 (0)