Filter uncanny-automator

automator_date_time_format

Filters the date and time format used throughout the Automator plugin for displaying specific dates and times.

add_filter( 'automator_date_time_format', $callback, 10, 1 );

Description

Filters the default date and time format for the Automator plugin. Developers can use this hook to customize how dates and times are displayed throughout the plugin, ensuring consistency with their site's specific formatting needs.


Usage

add_filter( 'automator_date_time_format', 'your_function_name', 10, 1 );

Return Value

The filtered value.


Examples

add_filter( 'automator_date_time_format', 'my_custom_automator_date_format', 10, 1 );
/**
 * Changes the default date and time format for the Automator plugin.
 *
 * This function modifies the output of the 'automator_date_time_format' filter
 * to display dates and times in a more user-friendly format, for example,
 * 'YYYY-MM-DD HH:MM:SS'.
 *
 * @param string $format The current date and time format string.
 * @return string The modified date and time format string.
 */
function my_custom_automator_date_format( $format ) {
	// Let's assume we want a more database-friendly format.
	$custom_format = 'Y-m-d H:i:s';
	return $custom_format;
}

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/core/class-utilities.php:703

public static function automator_get_date_time_format() {
		return apply_filters( 'automator_date_time_format', 'F j, Y g:i a' );
	}

Scroll to Top