Filter hook 'wp_privacy_export_expiration'

in WP Core File wp-includes/functions.php at line 8397

View Source

wp_privacy_export_expiration

Filter Hook
Description
Filters the lifetime, in seconds, of a personal data export file. By default, the lifetime is 3 days. Once the file reaches that age, it will automatically be deleted by a cron job.

Hook Information

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

Hook Parameters

Type Name Description
int $expiration The expiration age of the export, in seconds.

Usage Examples

Basic Usage
<?php
// Hook into wp_privacy_export_expiration
add_filter('wp_privacy_export_expiration', 'my_custom_filter', 10, 1);

function my_custom_filter($expiration) {
    // Your custom filtering logic here
    return $expiration;
}

Source Code Context

wp-includes/functions.php:8397 - How this hook is used in WordPress core
<?php
8392  	 *
8393  	 * @since 4.9.6
8394  	 *
8395  	 * @param int $expiration The expiration age of the export, in seconds.
8396  	 */
8397  	$expiration = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS );
8398  
8399  	foreach ( (array) $export_files as $export_file ) {
8400  		$file_age_in_seconds = time() - filemtime( $export_file );
8401  
8402  		if ( $expiration < $file_age_in_seconds ) {

PHP Documentation

<?php
/**
	 * Filters the lifetime, in seconds, of a personal data export file.
	 *
	 * By default, the lifetime is 3 days. Once the file reaches that age, it will automatically
	 * be deleted by a cron job.
	 *
	 * @since 4.9.6
	 *
	 * @param int $expiration The expiration age of the export, in seconds.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/functions.php
Related Hooks

Related hooks will be displayed here in future updates.