Filter
rpress_stats_date
On this page
Filters a date after it has been converted to a timestamp.
Applied at the end of RPRESS_Stats::convert_date() for both start and end dates. The value is a Unix timestamp built with mktime() for predefined and string dates, or the unchanged numeric value for timestamps. The end flag tells whether the end of the period is being calculated.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$date | int | Converted timestamp. |
$end_date | bool | True when converting an end date. |
$stats | RPRESS_Stats | The stats object. |
Return value#
int. The timestamp.
Example#
function my_stats_date( $date, $end_date, $stats ) {
return $date;
}
add_filter( 'rpress_stats_date', 'my_stats_date', 10, 3 );
Notes#
Invalid dates return a WP_Error earlier, before this filter runs.
Source#
Applied in:
includes/class-rpress-stats.php(line 329), inRPRESS_Stats::convert_date()
See also#
Was this page helpful?
