WordPress.org

Make WordPress Core

Ticket #21330: 21330.4.patch

File 21330.4.patch, 1.6 KB (added by chriscct7, 4 years ago)
  • src/wp-includes/option.php

     
    695695         */
    696696        $value = apply_filters( 'pre_set_transient_' . $transient, $value, $expiration, $transient );
    697697
     698        /**
     699         * Filter the expiration for a transient before its value is set.
     700         *
     701         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     702         *
     703         * @since 4.4.0
     704         *
     705         * @param mixed  $value      New value of transient.
     706         * @param int    $expiration Time until expiration in seconds.
     707         * @param string $transient  Transient name.
     708         */
     709        $expiration = apply_filters( 'expiration_pre_set_transient_' . $transient, $expiration, $value, $transient );
     710
    698711        if ( wp_using_ext_object_cache() ) {
    699712                $result = wp_cache_set( $transient, $value, 'transient', $expiration );
    700713        } else {
     
    14811494
    14821495        $expiration = (int) $expiration;
    14831496
     1497        /**
     1498         * Filter the expiration for a transient before its value is set.
     1499         *
     1500         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     1501         *
     1502         * @since 4.4.0
     1503         *
     1504         * @param mixed  $value      New value of transient.
     1505         * @param int    $expiration Time until expiration in seconds.
     1506         * @param string $transient  Transient name.
     1507         */
     1508        $expiration = apply_filters( 'expiration_pre_set_site_transient_' . $transient, $expiration, $value, $transient );     
     1509
    14841510        if ( wp_using_ext_object_cache() ) {
    14851511                $result = wp_cache_set( $transient, $value, 'site-transient', $expiration );
    14861512        } else {