From 77f9c7bc53ac74c0cf22ca51ca7b44bfb024b0f4 Mon Sep 17 00:00:00 2001 From: Sorin Marta Date: Tue, 17 Nov 2026 17:22:48 +0000 Subject: [PATCH 1/2] Clear listing cache after admin plan update Fixes Strategy11/business-directory-premium#394 A changed expiration date now shows and sticks after saving when a persistent object cache is on. --- includes/admin/controllers/class-admin-listings.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/admin/controllers/class-admin-listings.php b/includes/admin/controllers/class-admin-listings.php index cc416a130..5f0f9e16d 100644 --- a/includes/admin/controllers/class-admin-listings.php +++ b/includes/admin/controllers/class-admin-listings.php @@ -729,6 +729,7 @@ public function maybe_update_plan( $post_id ) { $row['fee_images'] = absint( $new_plan['fee_images'] ); $wpdb->update( $wpdb->prefix . 'wpbdp_listings', $row, array( 'listing_id' => $post_id ) ); + WPBDP_Utils::cache_delete_group( 'wpbdp_listings' ); $not_expired = false; if ( $row['expiration_date'] ) { From 4c445065dc926a63913a91d20b828d0942831586 Mon Sep 17 00:00:00 2001 From: Sorin Marta Date: Tue, 17 Nov 2026 17:30:32 +0000 Subject: [PATCH 2/2] Delete the listing plan cache key directly after admin update Keeps the saved date from going stale when the group's tracked key list is missing it. --- includes/admin/controllers/class-admin-listings.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/admin/controllers/class-admin-listings.php b/includes/admin/controllers/class-admin-listings.php index 5f0f9e16d..9593a85d2 100644 --- a/includes/admin/controllers/class-admin-listings.php +++ b/includes/admin/controllers/class-admin-listings.php @@ -729,6 +729,8 @@ public function maybe_update_plan( $post_id ) { $row['fee_images'] = absint( $new_plan['fee_images'] ); $wpdb->update( $wpdb->prefix . 'wpbdp_listings', $row, array( 'listing_id' => $post_id ) ); + // Delete the plan key directly too, in case it's missing from the group's tracked keys. + wp_cache_delete( 'listing_fee_plan' . $post_id, 'wpbdp_listings' ); WPBDP_Utils::cache_delete_group( 'wpbdp_listings' ); $not_expired = false;