PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.64
Timetics – Appointment Booking Calendar & Scheduling v1.0.64
1.0.64 1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 All 65 releases
← All changes | core/customers/customer.php +7 -2 1.0.57 → 1.0.64 View file →
@@ -414,14 +414,19 @@
414 414 *
415 415 * @return WP_Query
416 416 */
417 417 private function booking_query() {
418 - $default_booking_status = timetics_get_option( 'default_booking_status', 'approved' );
418 + // Not tied to "default_booking_status" (that's what status a NEW
419 + // booking starts in, not which bookings count here) — otherwise an
420 + // approved booking can vanish from the customer's count/history the
421 + // moment it's approved, on any site where new bookings default to
422 + // pending. See core/reports/api-report.php for the same fix.
423 + $counted_statuses = apply_filters( 'timetics/report/counted_statuses', [ 'approved', 'completed' ] );
419 424
420 425 $query = new \WP_Query(
421 426 [
422 427 'post_type' => 'timetics-booking',
423 - 'post_status' => $default_booking_status,
428 + 'post_status' => $counted_statuses,
424 429 // @codingStandardsIgnoreStart
425 430 'meta_key' => '_tt_booking_customer',
426 431 'meta_value' => $this->id,
427 432 // @codingStandardsIgnoreEnd