Skip to content

Commit 01e553b

Browse files
committed
Options/Meta APIs: Rename setted_(site_)_transient to set_....
Deprecate the actions `setted_transient` and `setted_site_transient` in favour of `set_transient` and `set_site_transient` respectively. This serves two purposes, the name is consistent with the transient specific actions `set_(site_)_transient_{$transient}`, and to make the names grammatically correct. Props sukhendu2002, swissspidy, johnbillion, peterwilsoncc. Fixes #62849. git-svn-id: https://develop.svn.wordpress.org/trunk@59735 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d11377e commit 01e553b

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

src/wp-includes/option.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,14 +1596,26 @@ function set_transient( $transient, $value, $expiration = 0 ) {
15961596
/**
15971597
* Fires after the value for a transient has been set.
15981598
*
1599+
* @since 6.8.0
1600+
*
1601+
* @param string $transient The name of the transient.
1602+
* @param mixed $value Transient value.
1603+
* @param int $expiration Time until expiration in seconds.
1604+
*/
1605+
do_action( 'set_transient', $transient, $value, $expiration );
1606+
1607+
/**
1608+
* Fires after the transient is set.
1609+
*
15991610
* @since 3.0.0
16001611
* @since 3.6.0 The `$value` and `$expiration` parameters were added.
1612+
* @deprecated 6.8.0 Use {@see 'set_transient'} instead.
16011613
*
16021614
* @param string $transient The name of the transient.
16031615
* @param mixed $value Transient value.
16041616
* @param int $expiration Time until expiration in seconds.
16051617
*/
1606-
do_action( 'setted_transient', $transient, $value, $expiration );
1618+
do_action_deprecated( 'setted_transient', array( $transient, $value, $expiration ), '6.8.0', 'set_transient' );
16071619
}
16081620

16091621
return $result;
@@ -2673,16 +2685,28 @@ function set_site_transient( $transient, $value, $expiration = 0 ) {
26732685
*/
26742686
do_action( "set_site_transient_{$transient}", $value, $expiration, $transient );
26752687

2688+
/**
2689+
* Fires after the value for a site transient has been set.
2690+
*
2691+
* @since 6.8.0
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+
26762699
/**
26772700
* Fires after the value for a site transient has been set.
26782701
*
26792702
* @since 3.0.0
2703+
* @deprecated 6.8.0 Use {@see 'set_site_transient'} instead.
26802704
*
26812705
* @param string $transient The name of the site transient.
26822706
* @param mixed $value Site transient value.
26832707
* @param int $expiration Time until expiration in seconds.
26842708
*/
2685-
do_action( 'setted_site_transient', $transient, $value, $expiration );
2709+
do_action_deprecated( 'setted_site_transient', array( $transient, $value, $expiration ), '6.8.0', 'set_site_transient' );
26862710
}
26872711

26882712
return $result;

0 commit comments

Comments
 (0)