Make WordPress Core

Changeset 31414


Ignore:
Timestamp:
02/11/2015 05:11:18 PM (10 years ago)
Author:
johnbillion
Message:

Add $expiration as a parameter to the pre_set_transient_{$transient} filter.

Props mgibbs189
Fixes #30576

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/option.php

    r31278 r31414  
    629629function set_transient( $transient, $value, $expiration = 0 ) {
    630630
     631    $expiration = (int) $expiration;
     632
    631633    /**
    632634     * Filter a specific transient before its value is set.
     
    635637     *
    636638     * @since 3.0.0
    637      *
    638      * @param mixed $value New value of transient.
    639      */
    640     $value = apply_filters( 'pre_set_transient_' . $transient, $value );
    641 
    642     $expiration = (int) $expiration;
     639     * @since 4.2.0 Added `$expiration` parameter.
     640     *
     641     * @param mixed $value      New value of transient.
     642     * @param int   $expiration Time until expiration in seconds.
     643     */
     644    $value = apply_filters( 'pre_set_transient_' . $transient, $value, $expiration );
    643645
    644646    if ( wp_using_ext_object_cache() ) {
Note: See TracChangeset for help on using the changeset viewer.