@@ -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
/**
@@ -11395,11 +11397,11 @@ public function cache_flush_pods(
11395
11397
pods_init ()->refresh_existing_content_types_cache ( true );
11396
11398
11397
11399
if ( ! $ static_only ) {
11398
- // Delete transients in the database
11400
+ // Delete transients in the database.
11399
11401
$ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_transient_pods%' " );
11400
11402
$ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_transient_timeout_pods%' " );
11401
11403
11402
- // Delete Pods Options Cache in the database
11404
+ // Delete Pods Options Cache in the database.
11403
11405
$ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_pods_option_%' " );
11404
11406
11405
11407
if ( class_exists ( \Pods_Unit_Tests \Pods_UnitTestCase::class ) ) {
@@ -11409,9 +11411,16 @@ public function cache_flush_pods(
11409
11411
// Do normal cache clear.
11410
11412
pods_cache_clear ( true );
11411
11413
11414
+ // Maybe flush the full object cache.
11412
11415
if ( $ flush_object_cache ) {
11413
11416
wp_cache_flush ();
11414
11417
}
11418
+
11419
+ // Maybe delete all transients in the database.
11420
+ if ( $ delete_transients ) {
11421
+ $ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_transient_%' " );
11422
+ $ wpdb ->query ( "DELETE FROM ` {$ wpdb ->options }` WHERE `option_name` LIKE '_transient_timeout_%' " );
11423
+ }
11415
11424
}
11416
11425
11417
11426
if ( $ flush_rewrites ) {
@@ -11429,8 +11438,9 @@ public function cache_flush_pods(
11429
11438
* @param bool $flush_groups_and_fields Whether to flush cache for groups and fields.
11430
11439
* @param bool $static_only Whether to flush only static caches.
11431
11440
* @param bool $flush_object_cache Whether to fully flush object caches.
11441
+ * @param bool $delete_transients Whether to fully delete transients.
11432
11442
*/
11433
- do_action ( 'pods_cache_flushed ' , $ pod , $ flush_rewrites , $ flush_groups_and_fields , $ static_only , $ flush_object_cache );
11443
+ do_action ( 'pods_cache_flushed ' , $ pod , $ flush_rewrites , $ flush_groups_and_fields , $ static_only , $ flush_object_cache, $ flush_transients );
11434
11444
}
11435
11445
11436
11446
/**
0 commit comments