Skip to content

Commit ad4e4d2

Browse files
authored
Merge pull request #35 from BeAPI/herewithme-patch-1
Minor changes
2 parents c79abef + c5e44cf commit ad4e4d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

default-no-db-transients.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22
/*
3-
Plugin Name: No transients
3+
Plugin Name: No transients in database
44
Version: 1.0.0
5+
Description: Prevent transients from being stored in the database when external object cache is being used
56
Plugin URI: https://beapi.fr
67
Author: Be API
78
Author URI: https://beapi.fr
@@ -39,8 +40,6 @@ class NoTransients {
3940
* Initialize the class and set up hooks
4041
*/
4142
public function __construct() {
42-
43-
4443
// Prevent transients from being retrieved
4544
add_filter( 'pre_option', [ $this, 'prevent_transient_retrieval' ], 10, 2 );
4645

@@ -59,6 +58,7 @@ public function __construct() {
5958
// Show admin notice if no external object cache is being used
6059
add_action( 'admin_notices', [ $this, 'show_admin_notice' ] );
6160

61+
// Clean up transients from the database
6262
add_action( 'beapi_clean_transients', [ $this, 'cleanup_transients' ] );
6363
}
6464

@@ -67,6 +67,7 @@ public function __construct() {
6767
*
6868
* @param mixed $pre The pre-option value
6969
* @param string $option The option name
70+
*
7071
* @return mixed The modified pre-option value
7172
*/
7273
public function prevent_transient_retrieval( $pre, $option ) {
@@ -142,5 +143,4 @@ public function show_admin_notice() {
142143
}
143144
}
144145

145-
// Initialize the class
146146
new NoTransients();

0 commit comments

Comments
 (0)