Skip to content

Commit

Permalink
Fix error when extracting the transient keys
Browse files Browse the repository at this point in the history
  • Loading branch information
stayallive committed Jul 4, 2024
1 parent e0656c9 commit 71d95e6
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,23 @@ public function handle_all_filter( string $hook_name ): void {
// @TODO: This _shouldn't_ be necessary, but it is. Investigate.
$this->maybe_finish_current_span();

$this->record_transient_operation( 'put', func_get_args()[2] );
$transientKey = func_get_args()[2];

$this->record_transient_operation( 'put', $transientKey );
} elseif ( $this->str_starts_with( $hook_name, 'pre_transient_' ) || $this->str_starts_with( $hook_name, 'pre_site_transient_' ) ) {
// @TODO: This _shouldn't_ be necessary, but it is. Investigate.
$this->maybe_finish_current_span();

$this->record_transient_operation( 'get', func_get_args()[2] );
$transientKey = func_get_args()[2];

$this->record_transient_operation( 'get', $transientKey );
} elseif ( $this->str_starts_with( $hook_name, 'delete_transient_' ) || $this->str_starts_with( $hook_name, 'delete_site_transient_' ) ) {
// @TODO: This _shouldn't_ be necessary, but it is. Investigate.
$this->maybe_finish_current_span();

$this->record_transient_operation( 'remove', func_get_args()[1] );
$transientKey = func_get_args()[1];

$this->record_transient_operation( 'remove', $transientKey );
} elseif ( $this->str_starts_with( $hook_name, 'transient_' ) || $this->str_starts_with( $hook_name, 'site_transient_' ) ) {
$span = $this->maybe_pop_span();

Expand Down

0 comments on commit 71d95e6

Please sign in to comment.