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