|
2 | 2 |
|
3 | 3 | /** |
4 | 4 | * Plugin Name: Bluem ePayments, eMandates & iDIN |
5 | | - * Version: 1.3.32 |
| 5 | + * Version: 1.3.34 |
6 | 6 | * Plugin URI: https://bluem.nl/en/ |
7 | 7 | * Description: Bluem integration for WordPress and WooCommerce for Payments, eMandates, iDIN identity verification and much, much more |
8 | 8 | * Author: Bluem Payment Services |
@@ -293,7 +293,7 @@ function bluem_woocommerce_no_woocommerce_notice() { |
293 | 293 | /* translators: %s: the link to settings page */ |
294 | 294 | printf( wp_kses_post( 'De Bluem integratie is grotendeels afhankelijk van WooCommerce - installeer en/of activeer deze plug-in. <br/> |
295 | 295 | Gebruik je geen WooCommerce? Dan kan je deze melding en WooCommerce gerelateerde functionaliteiten uitzetten bij de %s.', 'bluem' ), |
296 | | - '<a href="' . esc_url( admin_url( 'admin.php?page=)bluem-settings' ) ) . '">' . esc_html__( 'Instellingen', 'bluem' ) . '</a>' ); |
| 296 | + '<a href="' . esc_url( admin_url( 'admin.php?page=bluem-settings' ) ) . '">' . esc_html__( 'Instellingen', 'bluem' ) . '</a>' ); |
297 | 297 | echo '</p> |
298 | 298 | </div>'; |
299 | 299 | } |
@@ -535,44 +535,51 @@ function bluem_plugin_activation() { |
535 | 535 | } |
536 | 536 |
|
537 | 537 |
|
538 | | -function bluem_requests_view() { |
| 538 | +function bluem_requests_view(): void |
| 539 | +{ |
539 | 540 | if ( isset( $_GET['request_id'] ) && $_GET['request_id'] !== "" ) { |
540 | 541 | if ( isset( $_GET['admin_action'] ) && $_GET['admin_action'] === "delete" ) { |
541 | 542 | bluem_db_delete_request_by_id( sanitize_text_field( wp_unslash( $_GET['request_id'] ) ) ); |
542 | 543 | wp_redirect( |
543 | 544 | esc_url( admin_url( "admin.php?page=bluem-transactions" ) ) |
544 | 545 | ); |
545 | | - } elseif ( isset( $_GET['admin_action'] ) && $_GET['admin_action'] === "status-update" ) { |
546 | | - bluem_update_request_by_id( sanitize_text_field( wp_unslash( $_GET['request_id'] ) ) ); |
| 546 | + return; |
| 547 | + } |
547 | 548 |
|
548 | | - bluem_requests_view_request(); |
549 | | - } else { |
550 | | - bluem_requests_view_request(); |
| 549 | + if ( isset( $_GET['admin_action'] ) && $_GET['admin_action'] === "status-update" ) { |
| 550 | + bluem_update_request_by_id( sanitize_text_field( wp_unslash( $_GET['request_id'] ) ) ); |
551 | 551 | } |
552 | | - } else { |
553 | | - $filters = []; |
554 | | - $enabled_modules = bluem_filter_request_types_enabled( BLUEM_TRANSACTION_REQUEST_TYPES ); |
555 | | - if ( str_contains( $_GET['request_type'], ',' ) ) { |
556 | | - $multiple_filters = explode( ',', $_GET['request_type'] ); |
557 | | - $filters = array_intersect( $multiple_filters, BLUEM_TRANSACTION_REQUEST_TYPES ); |
558 | | - |
559 | | - // fallback to first enabled module if no valid filter found |
560 | | - if ( count( $filters ) === 0 ) { |
561 | | - $filters = $enabled_modules[0]; |
562 | | - } |
563 | 552 |
|
564 | | - $current_category = $filters[0]; |
565 | | - } else if ( isset( $_GET['request_type'] ) && in_array( $_GET['request_type'], BLUEM_TRANSACTION_REQUEST_TYPES, true ) ) { |
566 | | - $filters = [ $_GET['request_type'] ]; |
567 | | - $current_category = $_GET['request_type']; |
568 | | - } else { |
569 | | - $filters = $enabled_modules[0]; |
570 | | - $current_category = $enabled_modules[0]; |
| 553 | + bluem_requests_view_request(); |
| 554 | + return; |
| 555 | + } |
| 556 | + |
| 557 | + $filters = []; |
| 558 | + $enabled_modules = bluem_filter_request_types_enabled( BLUEM_TRANSACTION_REQUEST_TYPES ); |
| 559 | + if ( str_contains( $_GET['request_type'], ',' ) ) { |
| 560 | + $multiple_filters = explode(',', $_GET['request_type']); |
| 561 | + $filters = array_intersect($multiple_filters, BLUEM_TRANSACTION_REQUEST_TYPES); |
| 562 | + |
| 563 | + // fallback to first enabled module if no valid filter found |
| 564 | + if (count($filters) === 0) { |
| 565 | + $filters = $enabled_modules[0]; |
571 | 566 | } |
| 567 | + } |
572 | 568 |
|
573 | | - var_dump( $current_category ); |
574 | | - bluem_requests_view_with_filter( $filters, $current_category ); |
| 569 | + |
| 570 | + if (count($filters) > 0) { |
| 571 | + $current_category = $filters[0] ?? ''; |
| 572 | + } else if ( isset( $_GET['request_type'] ) && in_array( $_GET['request_type'], BLUEM_TRANSACTION_REQUEST_TYPES, true ) ) { |
| 573 | + $filters = [ $_GET['request_type'] ]; |
| 574 | + $current_category = $_GET['request_type'] ?? ''; |
| 575 | + } else if(!empty($enabled_modules[0])) { |
| 576 | + $filters = $enabled_modules[0]; |
| 577 | + $current_category = $enabled_modules[0]; |
| 578 | + } else { |
| 579 | + $current_category = ''; |
575 | 580 | } |
| 581 | + |
| 582 | + bluem_requests_view_with_filter( $filters, $current_category ?? '' ); |
576 | 583 | } |
577 | 584 |
|
578 | 585 | function bluem_filter_request_types_enabled( array $types ): array { |
|
0 commit comments