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