Filter hook 'transient_{$transient}'

in WP Core File wp-includes/option.php at line 1491

View Source

transient_{$transient}

Filter Hook
Description
Filters an existing transient's value. The dynamic portion of the hook name, `$transient`, refers to the transient name.

Hook Information

File Location wp-includes/option.php View on GitHub
Hook Type Filter
Line Number 1491

Hook Parameters

Type Name Description
mixed $value Value of transient.
string $transient Transient name.

Usage Examples

Basic Usage
<?php
// Hook into transient_{$transient}
add_filter('transient_{$transient}', 'my_custom_filter', 10, 2);

function my_custom_filter($value, $transient) {
    // Your custom filtering logic here
    return $value;
}

Source Code Context

wp-includes/option.php:1491 - How this hook is used in WordPress core
<?php
1486  	 * @since 4.4.0 The `$transient` parameter was added
1487  	 *
1488  	 * @param mixed  $value     Value of transient.
1489  	 * @param string $transient Transient name.
1490  	 */
1491  	return apply_filters( "transient_{$transient}", $value, $transient );
1492  }
1493  
1494  /**
1495   * Sets/updates the value of a transient.
1496   *

PHP Documentation

<?php
/**
	 * Filters an existing transient's value.
	 *
	 * The dynamic portion of the hook name, `$transient`, refers to the transient name.
	 *
	 * @since 2.8.0
	 * @since 4.4.0 The `$transient` parameter was added
	 *
	 * @param mixed  $value     Value of transient.
	 * @param string $transient Transient name.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/option.php
Related Hooks

Related hooks will be displayed here in future updates.