← All changes
|
includes/page-appointment-services/appointment_services__page.php
+3
-29
11.8.4
→
11.9
View file →
| @@ -40,11 +40,10 @@ | ||
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Resolve the Service that should be selected when the catalog first opens. |
| 43 | 43 | * |
| 44 | - * An explicit `service_id` request always wins. The first owner-visible active | |
| 45 | - * Service is selected automatically only on the Service and Provider Setup | |
| 46 | - * Wizard step, leaving ordinary Services-page visits unchanged. | |
| 44 | + * An explicit `service_id` request opens that Service. Ordinary catalog visits | |
| 45 | + * do not infer a selection from Setup Wizard state. | |
| 47 | 46 | * |
| 48 | 47 | * @return int Initial Service ID, or zero when the inspector should stay closed. |
| 49 | 48 | */ |
| 50 | 49 | function wpbc_appointment_services_get_initial_service_id() { |
| @@ -54,34 +53,9 @@ | ||
| 54 | 53 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only selection state. |
| 55 | 54 | ? absint( wp_unslash( $_GET['service_id'] ) ) |
| 56 | 55 | : 0; |
| 57 | 56 | |
| 58 | - if ( $requested_service_id ) { | |
| 59 | - return $requested_service_id; | |
| 60 | - } | |
| 61 | - | |
| 62 | - if ( | |
| 63 | - ! function_exists( 'wpbc_setup_wizard_page__is_active_step' ) | |
| 64 | - || ! wpbc_setup_wizard_page__is_active_step( 'service_provider' ) | |
| 65 | - || ! function_exists( 'wpbc_appointment_services_repository' ) | |
| 66 | - ) { | |
| 67 | - return 0; | |
| 68 | - } | |
| 69 | - | |
| 70 | - $services = wpbc_appointment_services_repository()->list_items( | |
| 71 | - array( | |
| 72 | - 'status' => 'active', | |
| 73 | - 'sort_by' => 'service_id', | |
| 74 | - 'sort_order' => 'asc', | |
| 75 | - 'limit' => 1, | |
| 76 | - ) | |
| 77 | - ); | |
| 78 | - | |
| 79 | - if ( is_wp_error( $services ) || empty( $services[0]['service_id'] ) ) { | |
| 80 | - return 0; | |
| 81 | - } | |
| 82 | - | |
| 83 | - return absint( $services[0]['service_id'] ); | |
| 57 | + return $requested_service_id; | |
| 84 | 58 | } |
| 85 | 59 | |
| 86 | 60 | /** |
| 87 | 61 | * Migrate released Service listing preferences into the shared catalog namespace. |