Action hook 'set_site_transient'

in WP Core File wp-includes/option.php at line 2697

View Source

set_site_transient

Action Hook
Description
Fires after the value for a site transient has been set.

Hook Information

File Location wp-includes/option.php View on GitHub
Hook Type Action
Line Number 2697

Hook Parameters

Type Name Description
string $transient The name of the site transient.
mixed $value Site transient value.
int $expiration Time until expiration in seconds.

Usage Examples

Basic Usage
<?php
// Hook into set_site_transient
add_action('set_site_transient', 'my_custom_function', 10, 3);

function my_custom_function($transient, $value, $expiration) {
    // Your custom code here
}

Source Code Context

wp-includes/option.php:2697 - How this hook is used in WordPress core
<?php
2692  		 *
2693  		 * @param string $transient  The name of the site transient.
2694  		 * @param mixed  $value      Site transient value.
2695  		 * @param int    $expiration Time until expiration in seconds.
2696  		 */
2697  		do_action( 'set_site_transient', $transient, $value, $expiration );
2698  
2699  		/**
2700  		 * Fires after the value for a site transient has been set.
2701  		 *
2702  		 * @since 3.0.0

PHP Documentation

<?php
/**
		 * Fires after the value for a site transient has been set.
		 *
		 * @since 6.8.0
		 *
		 * @param string $transient  The name of the site transient.
		 * @param mixed  $value      Site transient value.
		 * @param int    $expiration Time until expiration in seconds.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 3
  • File: wp-includes/option.php
Related Hooks

Related hooks will be displayed here in future updates.