Skip to content

Commit

Permalink
Add WP filters and actions in method
Browse files Browse the repository at this point in the history
  • Loading branch information
GiuseppeArcifa committed Dec 4, 2024
1 parent b7ea72b commit 0ec2a6f
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion includes/Helpers/Transient.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,26 @@ public static function delete( $key ): bool {
return \delete_transient( $key );
}

return \delete_option( $key );
/**
* Implement the filters as used in {@see set_transient()}.
*
* @param string $key Transient name.
*/
do_action( "delete_transient_{$key}", $key );

$result = \delete_option( $key );

if ( $result ) {

/**
* Implement the filters as used in {@see set_transient()}.
*
* @param string $transient Deleted transient name.
*/
do_action( 'deleted_transient', $key );
}

return $result;
}

/**
Expand Down

0 comments on commit 0ec2a6f

Please sign in to comment.