Skip to content

Commit

Permalink
Minor perfomance improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
girafffee committed Nov 7, 2023
1 parent a2c91b1 commit 614f30f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions includes/form-messages/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ public function get_form_types_messages() {

public function get_action_types_messages() {
$messages = array();
$actions = array();

/** @var Base $action */
foreach ( jet_form_builder()->msg_router->get_actions() as $action ) {
$messages = array_merge( $messages, Action_Messages_Manager::instance()->get_messages_values( $action ) );
$actions[] = Action_Messages_Manager::instance()->get_messages_values( $action );
}

return $messages;
return array_merge( $messages, ...$actions );
}

public function isset_message_type( $type ) {
Expand Down Expand Up @@ -108,19 +109,19 @@ public static function parse_message( $status ) {
}

/**
* @since 3.1.0
*
* @param string $message
*
* @since 3.1.0
*/
public function set_success( string $message ) {
$this->set_message( 'success', $message );
}

/**
* @since 3.1.0
*
* @param string $type
* @param string $message
*
* @since 3.1.0
*/
public function set_message( string $type, string $message ) {
$this->_types[ $type ] = $message;
Expand Down

0 comments on commit 614f30f

Please sign in to comment.