-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add trait for performance hints filter
- Loading branch information
Showing
3 changed files
with
29 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace WP_Rocket\Engine\Common\PerformanceHints\Cron; | ||
|
||
trait FilterTrait { | ||
/** | ||
* Performance Hints Deletion interval filter. | ||
* | ||
* @param string $filter The filter name. | ||
* | ||
* @return int | ||
*/ | ||
public function deletion_interval( string $filter ): int { | ||
/** | ||
* Filters the interval (in months) to determine when a performance data entry is considered 'old'. | ||
* Old performance entries are eligible for deletion. By default, a performance entry is considered old if it hasn't been accessed in the last month. | ||
* | ||
* @param int $delete_interval The interval in months after which a performance data entry is considered old. Default is 1 month. | ||
*/ | ||
return wpm_apply_filters_typed( 'integer', $filter, 1 ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters