Skip to content

Commit

Permalink
Options/Meta APIs: Rename setted_(site_)_transient to set_....
Browse files Browse the repository at this point in the history
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
  • Loading branch information
peterwilsoncc committed Jan 30, 2025
1 parent d11377e commit 01e553b
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/wp-includes/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -1596,14 +1596,26 @@ function set_transient( $transient, $value, $expiration = 0 ) {
/**
* Fires after the value for a transient has been set.
*
* @since 6.8.0
*
* @param string $transient The name of the transient.
* @param mixed $value Transient value.
* @param int $expiration Time until expiration in seconds.
*/
do_action( 'set_transient', $transient, $value, $expiration );

/**
* Fires after the transient is set.
*
* @since 3.0.0
* @since 3.6.0 The `$value` and `$expiration` parameters were added.
* @deprecated 6.8.0 Use {@see 'set_transient'} instead.
*
* @param string $transient The name of the transient.
* @param mixed $value Transient value.
* @param int $expiration Time until expiration in seconds.
*/
do_action( 'setted_transient', $transient, $value, $expiration );
do_action_deprecated( 'setted_transient', array( $transient, $value, $expiration ), '6.8.0', 'set_transient' );
}

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

/**
* 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.
*/
do_action( 'set_site_transient', $transient, $value, $expiration );

/**
* Fires after the value for a site transient has been set.
*
* @since 3.0.0
* @deprecated 6.8.0 Use {@see 'set_site_transient'} instead.
*
* @param string $transient The name of the site transient.
* @param mixed $value Site transient value.
* @param int $expiration Time until expiration in seconds.
*/
do_action( 'setted_site_transient', $transient, $value, $expiration );
do_action_deprecated( 'setted_site_transient', array( $transient, $value, $expiration ), '6.8.0', 'set_site_transient' );
}

return $result;
Expand Down

0 comments on commit 01e553b

Please sign in to comment.