diff --git a/wp-includes/option.php b/wp-includes/option.php index 701e485cf9..4ee24fdf4b 100644 --- a/wp-includes/option.php +++ b/wp-includes/option.php @@ -695,6 +695,19 @@ function set_transient( $transient, $value, $expiration = 0 ) { */ $value = apply_filters( 'pre_set_transient_' . $transient, $value, $expiration, $transient ); + /** + * Filter the expiration for a transient before its value is set. + * + * The dynamic portion of the hook name, `$transient`, refers to the transient name. + * + * @since 4.4.0 + * + * @param mixed $value New value of transient. + * @param int $expiration Time until expiration in seconds. + * @param string $transient Transient name. + */ + $expiration = apply_filters( 'expiration_pre_set_transient_' . $transient, $expiration, $value, $transient ); + if ( wp_using_ext_object_cache() ) { $result = wp_cache_set( $transient, $value, 'transient', $expiration ); } else { @@ -1589,6 +1602,19 @@ function set_site_transient( $transient, $value, $expiration = 0 ) { $expiration = (int) $expiration; + /** + * Filter the expiration for a transient before its value is set. + * + * The dynamic portion of the hook name, `$transient`, refers to the transient name. + * + * @since 4.4.0 + * + * @param mixed $value New value of transient. + * @param int $expiration Time until expiration in seconds. + * @param string $transient Transient name. + */ + $expiration = apply_filters( 'expiration_pre_set_site_transient_' . $transient, $expiration, $value, $transient ); + if ( wp_using_ext_object_cache() ) { $result = wp_cache_set( $transient, $value, 'site-transient', $expiration ); } else { diff --git a/wp-includes/version.php b/wp-includes/version.php index 5270e88fa5..cc8f507c27 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34864'; +$wp_version = '4.4-alpha-34865'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.