Make WordPress Core

Ticket #30576: option.php.2.patch

File option.php.2.patch, 968 bytes (added by mgibbs189, 12 years ago)
  • option.php

     
    627627 */
    628628function set_transient( $transient, $value, $expiration = 0 ) {
    629629
     630        $expiration = (int) $expiration;
     631
    630632        /**
    631633         * Filter a specific transient before its value is set.
    632634         *
     
    633635         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
    634636         *
    635637         * @since 3.0.0
     638         * @since 4.2.0 Added `$expiration` parameter.
    636639         *
    637640         * @param mixed $value New value of transient.
     641         * @param int $expiration Time until expiration in seconds.
    638642         */
    639         $value = apply_filters( 'pre_set_transient_' . $transient, $value );
     643        $value = apply_filters( 'pre_set_transient_' . $transient, $value, $expiration );
    640644
    641         $expiration = (int) $expiration;
    642 
    643645        if ( wp_using_ext_object_cache() ) {
    644646                $result = wp_cache_set( $transient, $value, 'transient', $expiration );
    645647        } else {