Skip to content

Commit 7d1c9c5

Browse files
committed
fix/40: Do not hook all_options everytime for performance issues.
1 parent a61d131 commit 7d1c9c5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

default-no-db-transients.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ public function remove_transients_from_alloptions( $alloptions ) {
9696
delete_option( $option );
9797
}
9898

99+
/**
100+
* Since all_options is called at each WordPres get_option, we need to unhook to not parse it each time.
101+
**/
102+
remove_filter( 'alloptions', [ $this, 'remove_transients_from_alloptions' ] );
103+
104+
99105
return $alloptions;
100106
}
101107

0 commit comments

Comments
 (0)