set_site_transient_<transient>

Fires after the value for a specific site transient has been set.

Description

do_action( 'set_site_transient_<transient>', (mixed) $value, (int) $expiration, (string) $transient ); 

The dynamic portion(s) of the hook name refer to the transient name.

Parameters (3)

0. $value (mixed)
Site transient value.
1. $expiration (int)
Time until expiration in seconds.
2. $transient (string)
Transient name.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'set_site_transient_{$transient}', $value, $expiration, $transient ); 
The following example is for adding a hook callback.
  1. // define the set_site_transient_<transient> callback 
  2. function action_set_site_transient_transient( $value, $expiration, $transient ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( "set_site_transient_{$transient}", 'action_set_site_transient_transient', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( "set_site_transient_{$transient}", 'action_set_site_transient_transient', 10, 3 ); 

Defined (1)

The action is defined in the following location(s).

/wp-includes/option.php  
  1. do_action( 'set_site_transient_' . $transient, $value, $expiration, $transient );