@@ -327,17 +327,17 @@ discard block |
||
327 | 327 | public static function populate_on_submit_data( &$form_options, $action = null, $event = 'create' ) { |
328 | 328 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
329 | 329 | if ( ! $action || ! is_object( $action ) ) { |
330 | - $form_options[ $opt . 'action' ] = self::get_default_action_type(); |
|
331 | - $form_options[ $opt . 'msg' ] = self::get_default_msg(); |
|
330 | + $form_options[$opt . 'action'] = self::get_default_action_type(); |
|
331 | + $form_options[$opt . 'msg'] = self::get_default_msg(); |
|
332 | 332 | |
333 | 333 | return; |
334 | 334 | } |
335 | 335 | |
336 | - $form_options[ $opt . 'action' ] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
336 | + $form_options[$opt . 'action'] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message'; |
|
337 | 337 | |
338 | - switch ( $form_options[ $opt . 'action' ] ) { |
|
338 | + switch ( $form_options[$opt . 'action'] ) { |
|
339 | 339 | case 'redirect': |
340 | - $form_options[ $opt . 'url' ] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
340 | + $form_options[$opt . 'url'] = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : ''; |
|
341 | 341 | $form_options['open_in_new_tab'] = ! empty( $action->post_content['open_in_new_tab'] ); |
342 | 342 | $form_options['redirect_delay'] = ! empty( $action->post_content['redirect_delay'] ); |
343 | 343 | $form_options['redirect_delay_time'] = $action->post_content['redirect_delay_time']; |
@@ -345,11 +345,11 @@ discard block |
||
345 | 345 | break; |
346 | 346 | |
347 | 347 | case 'page': |
348 | - $form_options[ $opt . 'page_id' ] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
348 | + $form_options[$opt . 'page_id'] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : ''; |
|
349 | 349 | break; |
350 | 350 | |
351 | 351 | default: |
352 | - $form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
352 | + $form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg(); |
|
353 | 353 | $form_options['show_form'] = ! empty( $action->post_content['show_form'] ); |
354 | 354 | } |
355 | 355 | } |
@@ -438,20 +438,20 @@ discard block |
||
438 | 438 | private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) { |
439 | 439 | $opt = 'update' === $event ? 'edit_' : 'success_'; |
440 | 440 | $data = array( |
441 | - 'success_action' => isset( $form_options[ $opt . 'action' ] ) ? $form_options[ $opt . 'action' ] : self::get_default_action_type(), |
|
441 | + 'success_action' => isset( $form_options[$opt . 'action'] ) ? $form_options[$opt . 'action'] : self::get_default_action_type(), |
|
442 | 442 | ); |
443 | 443 | |
444 | 444 | switch ( $data['success_action'] ) { |
445 | 445 | case 'redirect': |
446 | - $data['success_url'] = isset( $form_options[ $opt . 'url' ] ) ? $form_options[ $opt . 'url' ] : ''; |
|
446 | + $data['success_url'] = isset( $form_options[$opt . 'url'] ) ? $form_options[$opt . 'url'] : ''; |
|
447 | 447 | break; |
448 | 448 | |
449 | 449 | case 'page': |
450 | - $data['success_page_id'] = isset( $form_options[ $opt . 'page_id' ] ) ? $form_options[ $opt . 'page_id' ] : ''; |
|
450 | + $data['success_page_id'] = isset( $form_options[$opt . 'page_id'] ) ? $form_options[$opt . 'page_id'] : ''; |
|
451 | 451 | break; |
452 | 452 | |
453 | 453 | default: |
454 | - $data['success_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : self::get_default_msg(); |
|
454 | + $data['success_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : self::get_default_msg(); |
|
455 | 455 | $data['show_form'] = ! empty( $form_options['show_form'] ); |
456 | 456 | } |
457 | 457 |