@@ -11311,17 +11311,19 @@ public function csv_to_php( $data, $delimiter = ',' ) {
11311
11311
* @param bool $flush_groups_and_fields Whether to flush cache for groups and fields.
11312
11312
* @param bool $static_only Whether to flush only static caches.
11313
11313
* @param bool $flush_object_cache Whether to fully flush object caches.
11314
+ * @param bool $delete_transients Whether to fully delete transients.
11314
11315
*
11315
11316
* @return void
11316
11317
*
11317
11318
* @since 2.0.0
11318
11319
*/
11319
11320
public function cache_flush_pods (
11320
11321
$ 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
11325
11327
) {
11326
11328
11327
11329
/**
@@ -11396,11 +11398,11 @@ public function cache_flush_pods(
11396
11398
pods_init ()->refresh_existing_content_types_cache ( true );
11397
11399
11398
11400
if ( ! $ static_only ) {
11399
- // Delete transients in the database
11401
+ // Delete transients in the database.
11400
11402
$ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_transient_pods%' " );
11401
11403
$ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_transient_timeout_pods%' " );
11402
11404
11403
- // Delete Pods Options Cache in the database
11405
+ // Delete Pods Options Cache in the database.
11404
11406
$ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_pods_option_%' " );
11405
11407
11406
11408
if ( class_exists ( \Pods_Unit_Tests \Pods_UnitTestCase::class ) ) {
@@ -11410,9 +11412,16 @@ public function cache_flush_pods(
11410
11412
// Do normal cache clear.
11411
11413
pods_cache_clear ( true );
11412
11414
11415
+ // Maybe flush the full object cache.
11413
11416
if ( $ flush_object_cache ) {
11414
11417
wp_cache_flush ();
11415
11418
}
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
+ }
11416
11425
}
11417
11426
11418
11427
if ( $ flush_rewrites ) {
@@ -11430,8 +11439,9 @@ public function cache_flush_pods(
11430
11439
* @param bool $flush_groups_and_fields Whether to flush cache for groups and fields.
11431
11440
* @param bool $static_only Whether to flush only static caches.
11432
11441
* @param bool $flush_object_cache Whether to fully flush object caches.
11442
+ * @param bool $delete_transients Whether to fully delete transients.
11433
11443
*/
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 );
11435
11445
}
11436
11446
11437
11447
/**
0 commit comments