ulc_download_time_format
Filters the time format used for download timestamps, allowing customization of how time is displayed.
add_filter( 'ulc_download_time_format', $callback, 10, 1 );
Description
Filters the time format used for displaying download times. Developers can use this hook to customize the time display by returning a custom format string. It uses the WordPress `get_option( 'time_format' )` as the default.
Usage
add_filter( 'ulc_download_time_format', 'your_function_name', 10, 1 );
Return Value
The filtered value.
Examples
/**
* Example of how to modify the time format used for download display.
* This function changes the time format to include seconds.
*/
add_filter( 'ulc_download_time_format', function( $time_format ) {
// Append seconds to the existing time format.
return $time_format . ':s';
}, 10, 1 );
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
src/classes/helpers/class-database.php:980
src/classes/helpers/class-database.php:1133
$results = $wpdb->get_results( $qry );
if ( empty( $results ) ) {
return array();
}
$date_format = apply_filters( 'ulc_download_date_format', get_option( 'date_format' ) );
$time_format = apply_filters( 'ulc_download_time_format', get_option( 'time_format' ) );
$num_times_allowed = 1;
if ( is_numeric( $group ) ) {
$num_times_allowed = self::number_of_times_a_user_allowed_to_redeem( $group );
}
foreach ( $results as $result ) {
$val = (array) $result;