@@ -11311,17 +11311,19 @@ public function csv_to_php( $data, $delimiter = ',' ) {
1131111311 * @param bool $flush_groups_and_fields Whether to flush cache for groups and fields.
1131211312 * @param bool $static_only Whether to flush only static caches.
1131311313 * @param bool $flush_object_cache Whether to fully flush object caches.
11314+ * @param bool $delete_transients Whether to fully delete transients.
1131411315 *
1131511316 * @return void
1131611317 *
1131711318 * @since 2.0.0
1131811319 */
1131911320 public function cache_flush_pods (
1132011321 $ pod = null ,
11321- $ flush_rewrites = true ,
11322- $ flush_groups_and_fields = true ,
11323- $ static_only = false ,
11324- $ flush_object_cache = false
11322+ bool $ flush_rewrites = true ,
11323+ bool $ flush_groups_and_fields = true ,
11324+ bool $ static_only = false ,
11325+ bool $ flush_object_cache = false ,
11326+ bool $ delete_transients = false
1132511327 ) {
1132611328
1132711329 /**
@@ -11396,11 +11398,11 @@ public function cache_flush_pods(
1139611398 pods_init ()->refresh_existing_content_types_cache ( true );
1139711399
1139811400 if ( ! $ static_only ) {
11399- // Delete transients in the database
11401+ // Delete transients in the database.
1140011402 $ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_transient_pods%' " );
1140111403 $ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_transient_timeout_pods%' " );
1140211404
11403- // Delete Pods Options Cache in the database
11405+ // Delete Pods Options Cache in the database.
1140411406 $ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_pods_option_%' " );
1140511407
1140611408 if ( class_exists ( \Pods_Unit_Tests \Pods_UnitTestCase::class ) ) {
@@ -11410,9 +11412,16 @@ public function cache_flush_pods(
1141011412 // Do normal cache clear.
1141111413 pods_cache_clear ( true );
1141211414
11415+ // Maybe flush the full object cache.
1141311416 if ( $ flush_object_cache ) {
1141411417 wp_cache_flush ();
1141511418 }
11419+
11420+ // Maybe delete all transients in the database.
11421+ if ( $ delete_transients ) {
11422+ $ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_transient_%' " );
11423+ $ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_transient_timeout_%' " );
11424+ }
1141611425 }
1141711426
1141811427 if ( $ flush_rewrites ) {
@@ -11430,8 +11439,9 @@ public function cache_flush_pods(
1143011439 * @param bool $flush_groups_and_fields Whether to flush cache for groups and fields.
1143111440 * @param bool $static_only Whether to flush only static caches.
1143211441 * @param bool $flush_object_cache Whether to fully flush object caches.
11442+ * @param bool $delete_transients Whether to fully delete transients.
1143311443 */
11434- do_action ( 'pods_cache_flushed ' , $ pod , $ flush_rewrites , $ flush_groups_and_fields , $ static_only , $ flush_object_cache );
11444+ do_action ( 'pods_cache_flushed ' , $ pod , $ flush_rewrites , $ flush_groups_and_fields , $ static_only , $ flush_object_cache, $ flush_transients );
1143511445 }
1143611446
1143711447 /**
0 commit comments